예제 #1
0
    def traceInit(self, aDEVS):
        """
        The trace functionality for XML output at initialization

        :param aDEVS: the model that transitioned
        """
        runTraceAtController(self.server, self.uid, aDEVS, [toStr(aDEVS.getModelFullName()), aDEVS.timeLast, "'EX'", "''", toStr(aDEVS.state.toXML()), toStr(aDEVS.state)])
예제 #2
0
    def traceInit(self, aDEVS):
        """
        Tracing done for the initialisation

        :param aDEVS: the model that was initialised
        """
        # You should only vary the 'myCustomParam_' part
        runTraceAtController(self.server, self.uid, aDEVS, [myCustomParam1, myCustomParam2])
예제 #3
0
    def traceExternal(self, aDEVS):
        """
        Tracing done for the external transition function

        :param aDEVS: the model that transitioned
        """
        # You should only vary the 'myCustomParam_' part
        runTraceAtController(self.server, self.uid, aDEVS, [myCustomParam1, myCustomParam2])
예제 #4
0
    def traceInit(self, aDEVS):
        """
        Tracing done for the initialisation

        :param aDEVS: the model that was initialised
        """
        # You should only vary the 'myCustomParam_' part
        runTraceAtController(self.server, self.uid, aDEVS,
                             [myCustomParam1, myCustomParam2])
예제 #5
0
    def traceExternal(self, aDEVS):
        """
        Tracing done for the external transition function

        :param aDEVS: the model that transitioned
        """
        # You should only vary the 'myCustomParam_' part
        runTraceAtController(self.server, self.uid, aDEVS,
                             [myCustomParam1, myCustomParam2])
예제 #6
0
    def traceExternal(self, aDEVS):
        """
        The trace functionality for Cell DEVS output at an external transition

        :param aDEVS: the model that transitioned
        """
        try:
            runTraceAtController(self.server, self.uid, aDEVS, [aDEVS.x, aDEVS.y, aDEVS.timeLast, toStr(aDEVS.state.toCellState())])
        except AttributeError:
            pass
예제 #7
0
    def traceInit(self, aDEVS):
        """
        Tracing done for the initialisation

        :param aDEVS: the model that was initialised
        """
        text = "\n"
        text += "\tINITIAL CONDITIONS in model <%s>\n" % aDEVS.getModelFullName()
        text += "\t\tInitial State: %s\n" % str(aDEVS.state)
        # Don't show the age
        text += "\t\tNext scheduled internal transition at time %.2f\n" % (aDEVS.timeNext[0])
        runTraceAtController(self.server, self.uid, aDEVS, [aDEVS.timeLast, '"' + text + '"'])
예제 #8
0
    def traceExternal(self, aDEVS):
        """
        The trace functionality for XML output at an external transition

        :param aDEVS: the model that transitioned
        """
        portInfo = ""
        for I in range(len(aDEVS.IPorts)):
            portInfo += "<port name=\""+ aDEVS.IPorts[I].getPortName()+"\" category=\"I\">\n"
            for j in aDEVS.myInput[aDEVS.IPorts[I]]:
                portInfo += "<message>" + str(j) + "</message>\n</port>\n"
        runTraceAtController(self.server, self.uid, aDEVS, [toStr(aDEVS.getModelFullName()), aDEVS.timeLast, "'EX'", toStr(portInfo), toStr(aDEVS.state.toXML()), toStr(aDEVS.state)])
예제 #9
0
    def traceExternal(self, aDEVS):
        """
        The trace functionality for Cell DEVS output at an external transition

        :param aDEVS: the model that transitioned
        """
        try:
            runTraceAtController(self.server, self.uid, aDEVS, [
                aDEVS.x, aDEVS.y, aDEVS.timeLast,
                toStr(aDEVS.state.toCellState())
            ])
        except AttributeError:
            pass
예제 #10
0
    def traceExternal(self, aDEVS):
        """
        The trace functionality for VCD output at an external transition

        :param aDEVS: the model that transitioned
        """
        name = toStr(aDEVS.getModelFullName())
        for I in range(len(aDEVS.IPorts)):
            portName = aDEVS.IPorts[I].getPortName()
            signalBag = aDEVS.myInput.get(aDEVS.IPorts[I], [])
            if signalBag is not None:
                for portSignal in signalBag:
                    runTraceAtController(self.server, self.uid, aDEVS, [name, aDEVS.timeLast, toStr(portName), toStr(portSignal)])
예제 #11
0
    def traceInternal(self, aDEVS):
        """
        Tracing done for the internal transition function

        :param aDEVS: the model that transitioned
        """
        text = "\n"
        text += "\tINTERNAL TRANSITION in model <%s>\n" % aDEVS.getModelFullName()
        text += "\t\tNew State: %s\n" % str(aDEVS.state)
        text += "\t\tOutput Port Configuration:\n"
        for I in range(len(aDEVS.OPorts)):
            text += "\t\t\tport <" + str(aDEVS.OPorts[I].getPortName()) + ">:\n"
            for msg in aDEVS.myOutput.get(aDEVS.OPorts[I], []):
                text += "\t\t\t\t" + str(msg) + "\n"
        # Don't show the age
        text += "\t\tNext scheduled internal transition at time %.2f\n" % (aDEVS.timeNext[0])
        runTraceAtController(self.server, self.uid, aDEVS, [aDEVS.timeLast, '"' + text + '"'])