!ProbabilityDistibution methodsFor: 'private'!
atEnd
^false! !
!Simulation methodsFor: 'initialization'!
activate
ProbabilityDistribution initialize.
SimulationObject activeSimulation: self.
Resource activeSimulation: self! !
!Simulation methosFor: 'scheduling'!
newProcessFor: aBlock
self startProcess.
[aBlock value.
self stopProcess]
forkAt: [Processor activePriority + 1]! !
!Simulation methodsFor: 'simulation control'!
proceed
|eventProcess|
[self readyToContinue] whileFalse: [Processsor yield].
eventQueue isEmpty
ifTrue: [^self finishUp]
ifFalse:[eventProcess _ eventQueue removeFirst.
currentTime _ eventProcess condition.
eventProcess resume]! !
!Simulation methodsFor: 'run a simulation'!
run
self startUp.
[eventQueue isEmpty] whileFalse: [self proceed]!
runUntil: aTime
self startUp.
[self time <= aTime and: [eventQueue isEmpty not]]
whileTrue: [self proceed]! !
After all you should not forget to close the files you opened for
gathering your statistics. Therefor you need the following method
at least in this class:
!EventMonitor class methodsFor: 'accessing'!
file
^file! !
If you don't close an open file, the last 512 bytes block will not
be written onto disk.
I hope you enjoy your simulation.
Peter Kubitzsch
Vogelpothsweg 92/2
4600 Dortmund 50
Germany