Commit 06ec4e3a authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Ioannis Papagiannopoulos

corrections in typing. Now topology9 does not crash, but it hangs forever

parent 37c84aaa
...@@ -25,7 +25,7 @@ Created on 12 Jul 2012 ...@@ -25,7 +25,7 @@ Created on 12 Jul 2012
Class that acts as an abstract. It should have no instances. All the core-objects should inherit from it Class that acts as an abstract. It should have no instances. All the core-objects should inherit from it
''' '''
from SimPy.Simulation import Process, Resource, now, SimEvent, waitEvent from SimPy.Simulation import Process, Resource, now, SimEvent, waitevent
# =========================================================================== # ===========================================================================
# the core object # the core object
...@@ -316,7 +316,7 @@ class CoreObject(Process): ...@@ -316,7 +316,7 @@ class CoreObject(Process):
# ======================================================================= # =======================================================================
def selectReceiver(self,possibleReceivers=[]): def selectReceiver(self,possibleReceivers=[]):
activeObject=self.getActiveObject() activeObject=self.getActiveObject()
candidates=possibleReceivevrs candidates=possibleReceivers
# dummy variables that help prioritize the objects requesting to give objects to the Machine (activeObject) # dummy variables that help prioritize the objects requesting to give objects to the Machine (activeObject)
maxTimeWaiting=0 # dummy variable counting the time a successor is waiting maxTimeWaiting=0 # dummy variable counting the time a successor is waiting
receiver=None receiver=None
......
...@@ -26,7 +26,7 @@ Created on 8 Nov 2012 ...@@ -26,7 +26,7 @@ Created on 8 Nov 2012
models the source object that generates the entities models the source object that generates the entities
''' '''
from SimPy.Simulation import now, Process, Resource, infinity, hold, SimEvent from SimPy.Simulation import now, Process, Resource, infinity, hold, SimEvent, activate
from RandomNumberGenerator import RandomNumberGenerator from RandomNumberGenerator import RandomNumberGenerator
from CoreObject import CoreObject from CoreObject import CoreObject
from Globals import G from Globals import G
...@@ -49,7 +49,8 @@ class EntityGenerator(Process): ...@@ -49,7 +49,8 @@ class EntityGenerator(Process):
# initialize method of the EntityGenerator # initialize method of the EntityGenerator
#=========================================================================== #===========================================================================
def initialize(self): def initialize(self):
Process.initialize(self) pass
#Process.initialize(self)
#=========================================================================== #===========================================================================
# the generator of the EntitiesGenerator # the generator of the EntitiesGenerator
...@@ -59,11 +60,11 @@ class EntityGenerator(Process): ...@@ -59,11 +60,11 @@ class EntityGenerator(Process):
entity=self.victim.createEntity() # create the Entity object and assign its name entity=self.victim.createEntity() # create the Entity object and assign its name
entity.creationTime=now() # assign the current simulation time as the Entity's creation time entity.creationTime=now() # assign the current simulation time as the Entity's creation time
entity.startTime=now() # assign the current simulation time as the Entity's start time entity.startTime=now() # assign the current simulation time as the Entity's start time
entity.currentStation=victim # update the current station of the Entity entity.currentStation=self.victim # update the current station of the Entity
G.EntityList.append(entity) G.EntityList.append(entity)
self.victim.outputTrace(entity.name, "generated") # output the trace self.victim.outputTrace(entity.name, "generated") # output the trace
victim.getActiveObjectQueue().append(entity) # append the entity to the resource self.victim.getActiveObjectQueue().append(entity) # append the entity to the resource
victim.numberOfArrivals+=1 # we have one new arrival self.victim.numberOfArrivals+=1 # we have one new arrival
G.numberOfEntities+=1 G.numberOfEntities+=1
yield hold,self,self.victim.calculateInterarrivalTime() # wait until the next arrival yield hold,self,self.victim.calculateInterarrivalTime() # wait until the next arrival
self.victim.entityCreated.signal(str(entity.id)+' created') self.victim.entityCreated.signal(str(entity.id)+' created')
...@@ -94,7 +95,7 @@ class Source(CoreObject): ...@@ -94,7 +95,7 @@ class Source(CoreObject):
self.item=Globals.getClassFromName(entity) #the type of object that the Source will generate self.item=Globals.getClassFromName(entity) #the type of object that the Source will generate
self.generator=EntityGenerator(victim=self) # the EntityGenerator of the Source self.entityGenerator=EntityGenerator(victim=self) # the EntityGenerator of the Source
self.entityCreated=SimEvent('an entity is created') self.entityCreated=SimEvent('an entity is created')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment