Go to the documentation of this file.
84 Rprintf(
"(time=%f,%s), ",
it->time,
it->event->str().c_str());
93 const Event * e = 0) throw() {
100 const Event * e = 0) throw() {
122 const Event * e = (*a).event;
134 const Event * e = (*it).event;
154 static bool lock =
false;
172 if (action.
event != 0)
174 delete(action.
event);
197 switch (action.
type) {
228 if (action.
event != 0)
230 delete(action.
event);
246 if (
processes[pid].terminated)
return -1;
const Time INIT_TIME
beginning of time
a_table_t::iterator ForwardIterator
bool operator<(const Action &a) const
GNU Free Documentation License March Inc Temple MA USA Everyone is permitted to copy and distribute verbatim copies of this license but changing it is not allowed PREAMBLE The purpose of this License is to make a or other written document free in the sense of with or without modifying it
virtual void initialize(void)
action executed when the process is initialized.
static ProcessId this_process()
returns the current process
static void signal_event(ProcessId p, const Event *e)
signal an event to the given process immediately
std::function< bool(const Event *)> EventPredicate
static ProcessId create_process(Process *)
creates a new process
static void schedule_now(ActionType i, ProcessId p, const Event *e=0)
static void set_error_handler(SimErrorHandler *)
registers a handler for simulation errors.
ProcessId pid() const
process id of this process.
static void stop_simulation()
stops execution of the simulation
Virtual class (interface) representing processes running within the simulator.
int ProcessId
process identifier type
virtual void stop(void)
executed when the process is explicitly stopped.
an error handler for simulation errors.
static void advance_delay(Time)
advance the execution time of the current process.
static void ignore_event(EventPredicate pred)
basic event in the simulation.
std::vector< T >::iterator iterator
static void set_stop_time(Time t=INIT_TIME)
stops the execution of the simulation at the given time
virtual void clear()
handles a clear operation.
ProcessId activate()
activates this process within the simulator.
virtual void handle_terminated(ProcessId p, const Event *e)
handles terminated-process conditions.
static void clear()
clears out internal data structures
static void self_signal_event(const Event *e)
signal an event to the current process immediately
static ProcessId current_process
std::vector< PDescr > PsTable
static void run_simulation()
starts execution of the simulation
static Time clock()
returns the current virtual time for the current process
virtual void handle_busy(ProcessId p, const Event *e)
handles busy-process conditions.
double Time
virtual time type
virtual void process_event(const Event *msg)
action executed in response to an event signaled to this process.
static void stop_process()
stops the execution of the current process
name space for the Siena simulator.
static void schedule(Time t, ActionType i, ProcessId p, const Event *e=0)
Action(Time t, ActionType at, ProcessId p, const Event *e=0)
const ProcessId NULL_PROCESSID
no process will be identified by NULL_PROCESSID
static SimErrorHandler * error_handler