next up previous contents index
Next: Atomic DEVS: Atomic Up: DEVS Previous: DEVS   Contents   Index

Base DEVS: Devs

Devs defined in Devs.h is an abstract class derived from Named.3.1 And it has the parent pointer assigned by AddModel() of Coupled as we will see in Section 2.2.3.
class DEVSpp_EXP Devs: public Named {
public:
    Coupled*  Parent; // parent pointer
    ...

There are adding, getting, removing, and printing functions for the input ports denoted as AddIP, GetIP, RemoveIP, and PrintAllIPs. Similarly, AddOP, GetOP, RemoveOP, and PrintAllOPs are available functions for the output ports.

    //-- Input Port related functions --
    InputPort* AddIP(const string& ipn);
    InputPort* GetIP(const string& ipn) const;
    InputPort* RemoveIP(const string& ipn);
    void PrintAllIPs() const;

    //-- Output Port related functions --
    OutputPort* AddOP(const string& opn);
    OutputPort* GetOP(const string& opn) const;
    OutputPort* RemoveOP(const string& opn);
    void PrintAllOPs() const;

Devs has time-related functions such as TimeLast() for getting the last schedule update time; TimeNext() for the next schedule time; TimeCurrent() for the current time; TimeRemaining() for the remaining time from the current time to the next schedule time; TimeElapsed() for the elapsed time between the last schedule time and the current time.

    Time TimeLast() const;
    Time TimeNext() const ;
    static Time TimeCurrent() ;
    Time TimeRemaining() const ;
    Time TimeElapsed() const ;

Figure 2.2 illustrates the relationships among different times. The user doesn't have to set the values of times since that will be done by DEVS++.

Figure 2.2: Relations of Times
\begin{figure}\centering\mbox {\epsfig{file=Times,width=0.8\columnwidth}}
\end{figure}



MHHwang 2007-05-07