Devs
defined in the source file Devs.cs
is an abstract class derived from
Named
. Devs
points its parent through its Parent
field
which is assigned by Coupled::AddModel()
(see Section 2.2.3).
public class Devs: 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.
In addition, IP
and OP
get the set of input ports as
SortedList<string, InputPort>
and the set of output ports
as SortedList<string, OutputPort>
, respectively.
//-- X port Methods -- InputPort AddIP(string ipn); InputPort GetIP(string ipn) const; InputPort RemoveIP(string ipn); void PrintAllIPs() ; public SortedList<string, InputPort> IP {get ; } //-- Y port Methods -- OutputPort AddOP(string opn); OutputPort GetOP(string opn) const; OutputPort RemoveOP(string opn); void PrintAllOPs() ; public SortedList<string, OutputPort> OP {get ; }
Devs
has time-related properties such as TimeLast
for getting (or setting) the last
schedule update time; TimeNext
for the next schedule time;
TimeElapsed
for the elapsed time between the last schedule
time and the current time; TimeRemaining
for the remaining
time from the current time to the next schedule time;
TimeAdvance
for the time difference between TimeNext
and TimeLast
.
TimeCurrent
is a static and public data field for the
current time;
public double TimeLast { get; set; } public double TimeNext { get; set; } public double TimeElapsed { get; } public double TimeRemaining { get; } public double TimeAdvance { get; } public static double TimeCurrent ; // data field
Figure 2.2 illustrates the relationships among
different times. The user doesn't have to set the values of these
time variables because such calculation will be performed by the
simulation engine class, called SRTEngine
in DEVS#,
according to the user-defined
for each state of each
model. For more detailed information this algorithm, the user can
refer to [Zei87,ZPK00]