Пример #1
0
 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)
Пример #2
0
 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
Пример #3
0
 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)
Пример #4
0
    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
        }
Пример #5
0
 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")
Пример #6
0
 def __init__(self):
     AtomicDEVS.__init__(self, "Generator")
     self.state = True
     self.outport = self.addOutPort("outport")
Пример #7
0
 def __init__(self, nr, load):
     AtomicDEVS.__init__(self, "Node" + str(nr))
     self.state = None
     self.load = load
Пример #8
0
 def __init__(self):
     AtomicDEVS.__init__(self, "Exchange")
     self.state = None
     self.inport = self.addInPort("in")
     self.outport = self.addOutPort("out")
Пример #9
0
 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()
Пример #10
0
 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")
Пример #11
0
 def __init__(self):
     AtomicDEVS.__init__(self, "Generator")
     self.state = True
     self.outport = self.addOutPort("outport")
Пример #12
0
 def __init__(self, name):
     AtomicDEVS.__init__(self, name)
     self.state = NetworkState()
     self.inport = self.addInPort("inport")
     self.outport = self.addOutPort("outport")