def __init__(self, name): AtomicDEVS.__init__(self, str(name)) self.inport = self.addInPort("inport") self.outport = self.addOutPort("outport") if name == 1: self.state = ModelState(2) else: self.state = ModelState(None)
def __init__(self, nr, count, multiplier): AtomicDEVS.__init__(self, "CircleNode" + str(nr)) self.inport = self.addInPort("input") self.outport = self.addOutPort("output") self.state = CircleNodeState() #self.state.event = random.randint(2, 100) self.state.nr = nr self.state.generated = 0 self.state.event = nr self.count = count self.multiplier = multiplier
def __init__(self, name, totalsize): AtomicDEVS.__init__(self, "Node_%i" % name) self.nodename = name self.totalsize = totalsize self.inports = [ self.addInPort("inport_%i" % i) for i in range(totalsize) ] self.outports = [ self.addOutPort("outport_%i" % i) for i in range(totalsize) ] self.state = NodeState(name, totalsize)
def __init__(self, x, y, x_max, y_max): AtomicDEVS.__init__(self, "Cell(%d, %d)" % (x, y)) self.state = CellState(T_AMBIENT) # For Cell DEVS tracing self.x = x self.y = y self.inports = [ self.addInPort("in_N"), self.addInPort("in_E"), self.addInPort("in_S"), self.addInPort("in_W"), self.addInPort("in_G") ] self.outport = self.addOutPort("out_T") self.taMap = { PH_INACTIVE: INFINITY, PH_UNBURNED: 1.0, PH_BURNING: 1.0, PH_BURNED: INFINITY }
def __init__(self): AtomicDEVS.__init__(self, "Queue") self.state = None self.processing_time = 1.0 self.inport = self.addInPort("input") self.outport = self.addOutPort("output")
def __init__(self): AtomicDEVS.__init__(self, "Generator") self.state = True self.outport = self.addOutPort("outport")
def __init__(self, nr, load): AtomicDEVS.__init__(self, "Node" + str(nr)) self.state = None self.load = load
def __init__(self): AtomicDEVS.__init__(self, "Exchange") self.state = None self.inport = self.addInPort("in") self.outport = self.addOutPort("out")
def __init__(self, levels): AtomicDEVS.__init__(self, "Generator") self.outports = [] for i in range(levels): self.outports.append(self.addOutPort("out_" + str(i))) self.state = Junk()
def __init__(self, name): AtomicDEVS.__init__(self, name) self.state = NetworkState() self.inport = self.addInPort("inport") self.outport = self.addOutPort("outport")