Class: ProjectSimulator::FrequencyConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/projectsimulator.rb

Instance Method Summary collapse

Constructor Details

#initialize(freq, debug: false) ⇒ FrequencyConstraint



379
380
381
382
# File 'lib/projectsimulator.rb', line 379

def initialize(freq, debug: false)
  @freq, @debug = freq, debug
  @counter = 0
end

Instance Method Details

#counterObject



384
385
386
# File 'lib/projectsimulator.rb', line 384

def counter()
  @counter
end

#incrementObject



388
389
390
# File 'lib/projectsimulator.rb', line 388

def increment()
  @counter += 1
end

#matchObject



392
393
394
# File 'lib/projectsimulator.rb', line 392

def match()
  @counter < @freq
end

#resetObject



396
397
398
399
400
# File 'lib/projectsimulator.rb', line 396

def reset()
  puts 'resetting' if @debug
@foo = 0      
@counter = 0
end