Commit 846742dc authored by Georgios Dagkakis's avatar Georgios Dagkakis

comments and method to return current simulation time added

parent 439af45f
...@@ -35,7 +35,7 @@ from random import Random, expovariate, gammavariate, normalvariate ...@@ -35,7 +35,7 @@ from random import Random, expovariate, gammavariate, normalvariate
import simpy import simpy
# =========================================================================== # ===========================================================================
# ManPyEnvironment # ManPyEnvironment here all the ManPy objects interact
# =========================================================================== # ===========================================================================
class ManPyEnvironment(object): class ManPyEnvironment(object):
def __init__(self,seed=1): def __init__(self,seed=1):
...@@ -118,12 +118,21 @@ class ManPyEnvironment(object): ...@@ -118,12 +118,21 @@ class ManPyEnvironment(object):
self.SimPyEnvironment=simpy.Environment() self.SimPyEnvironment=simpy.Environment()
self.env=self.SimPyEnvironment self.env=self.SimPyEnvironment
# ===========================================================================
# initializes the environment for every replication
# ===========================================================================
def initialize(self): def initialize(self):
self.SimPyEnvironment=simpy.Environment() self.SimPyEnvironment=simpy.Environment()
self.env=self.SimPyEnvironment self.env=self.SimPyEnvironment
for object in self.ObjList+self.ObjectInterruptionList+self.ObjectResourceList: for object in self.ObjList+self.ObjectInterruptionList+self.ObjectResourceList:
object.env=self.env object.env=self.env
# ===========================================================================
# returns the simulation time
# ===========================================================================
def now(self):
return self.SimPyEnvironment.now
# ======================================================================= # =======================================================================
# method to move entities exceeding a certain safety stock # method to move entities exceeding a certain safety stock
# ======================================================================= # =======================================================================
......
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