예제 #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
예제 #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))
예제 #3
0
 def createSharedObject(self, xmlSource):
     capacity = getXValue(xmlSource, "resources",
                          XValueHelper(self, XValueHelper.SIMULATION_CONTEXT))
     return Resource(int(capacity), sim=self.simulation)
예제 #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
예제 #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
예제 #6
0
 def createSharedObject(self, xmlSource):
     capacity = getXValue(
         xmlSource, "resources",
         XValueHelper(self, XValueHelper.SIMULATION_CONTEXT))
     return Resource(int(capacity), sim=self.simulation)
예제 #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
예제 #8
0
 def __init__(self, transaction, xmlSource):
     super().__init__(transaction, xmlSource)
     self.duration = getXValue(xmlSource, "duration", XValueHelper(self))