Ejemplo n.º 1
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.distance = getXValue(xmlSource, "distance", XValueHelper(self)) #km 
     self.velocity = getXValue(xmlSource, "velocity", XValueHelper(self)) #km/h
     
     self.limit = getXValue(xmlSource, "limit", XValueHelper(self), 0.0) #0.0-1.0
     self.delay = getXValue(xmlSource, "delay", XValueHelper(self)) #sec
     # output properties
     self.duration = None
     self.consumedEnergy = None
     self.batteryOut = False
Ejemplo n.º 2
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.epoch = Property(xmlSource.get("epoch", "s.t"))
     self.period = xmlSource.get("period", None)
     if self.period is not None:
         self.period = number(self.period)
     self.time = getXValue(xmlSource, "time", XValueHelper(self))
Ejemplo n.º 3
0
 def createSharedObject(self, xmlSource):
     capacity = getXValue(xmlSource, "resources",
                          XValueHelper(self, XValueHelper.SIMULATION_CONTEXT))
     return Resource(int(capacity), sim=self.simulation)
Ejemplo n.º 4
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.alarm = None
     self.maxWaiting = getXValue(xmlSource, "queue_waiting", self.xcontext)
     self.duration = getXValue(xmlSource, "duration", self.xcontext)
     self.usedResource = False
Ejemplo n.º 5
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.voltage = getXValue(xmlSource, "voltage", XValueHelper(self))
     self.current = getXValue(xmlSource, "current", XValueHelper(self))
     #output properties
     self.chargedEnergy = None
Ejemplo n.º 6
0
 def createSharedObject(self, xmlSource):
     capacity = getXValue(
         xmlSource, "resources",
         XValueHelper(self, XValueHelper.SIMULATION_CONTEXT))
     return Resource(int(capacity), sim=self.simulation)
Ejemplo n.º 7
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.alarm = None
     self.maxWaiting = getXValue(xmlSource, "queue_waiting", self.xcontext)
     self.duration = getXValue(xmlSource, "duration", self.xcontext)
     self.usedResource = False
Ejemplo n.º 8
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.duration = getXValue(xmlSource, "duration", XValueHelper(self))