🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.st80
Article #351

Re: Orphaned Response - (nf)

#351
From: kubitzsc
Date: Tue, 14 Oct 1986 18:30
69 lines
2207 bytes
Here are the changes I had to add to the simulation
methods shown in the 'Blue Book'. I added then on a PCS 
Cadmus 9200. There occurred no further problems while
running the examples and implementing others.
   

!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
Technical Details
Message-ID: <17400019@exunido.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!topaz!rutgers!lll-crg!seismo!mcvax!unido!exunido!kubitzsc
References: <307@unido.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!topaz!rutgers!lll-crg!seismo!mcvax!unido!exunido!kubitzsc
From: kubitzsc@exunido.UUCP
Newsgroups: net.lang.st80
Subject: Re: Orphaned Response - (nf)
Message-ID: <17400019@exunido.UUCP>
Date: Tue, 14-Oct-86 14:30:00 EDT
Article-I.D.: exunido.17400019
Posted: Tue Oct 14 14:30:00 1986
Date-Received: Mon, 20-Oct-86 22:46:09 EDT
References: <307@unido.UUCP>
Lines: 69
Nf-ID: #R:unido:-30700:exunido:17400019:37777777600:1565
Nf-From: exunido!kubitzsc    Oct 14 19:30:00 1986