indexpreviousnext

file name: evalsys.cpp
classification: evaluation
contents: dummy evaluation systems
use: provide an evaluation system to test the simulation in Linux
 

Note: the evaluation must be started before the simulation because it creates the server socket to which the simulation modules connect.

Note: If you have adapted SimUTC to your needs and want to modify the evaluation accordingly, here is where you might want to make changes:

Note: if you have defined the macro PLOT_DATA, then the evaluation prints various data collected during the simulation run into several files it creates in the directory PLOT_DIR. The SimUTC archive assumes that the data files are created in the directory SimUTC/Sources/Evalsys/gnuplot. There, you can find a file README that contains instructions on how to further process the files.
 

global items provided:

EBool g_byteOrderReversed: Is set to True if the byte order of communication peer is different from the local order. The variable is needed for calls to Convert().

int main (): The main function of the program. It executes the following steps:

INT32 round: The current round. The variable is set by PrintEvent().

INT32 supsid[ControllerIndex+1]: All socket IDs. First come the supervisor socket IDs, the last entry is the controller ID. The array is needed by SelectSocket().
 

local items used:

CUnixAddress addr (SOCKNAME): The address of the server socket in UNIX domain.
Alternatively, you can use CInternetAddress addr (EvalsysPort) if you want to use INET domain sockets.

void ConfigureNetworks(): Creates and configures numberOfNetworks networks.

int ConfigureNodes(): Creates and configures numberOfNodes nodes.

const INT32 ControllerIndex:  The index of the controller in all arrays that contain both supervisor and controller data. The supervisor indices are the same as their internal nodeIDs and start with 0 and go up to numberOfNodes-1, the controller is the last entry.

CStreamInterface *ctrl: Socket for the controller.

enum EErrorNumbers: All possible return values of the program.

SINT32 networkID[numberOfNetworks]: IDs of the networks. The array is set by ConfigureNetworks() and read by ConfigureNodes().

#define SOCKNAME: The name of the UNIX socket.

CStreamInterface *supsock[numberOfNodes]: Array of supervisor sockets.
 
 
 


last modified: Fri Feb 5 18:56:17 1999