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