|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLogicalProcess
Phold
public class Phold
This class is the java-version of the Phold.c from GTW. It is used for testing the sim kernel. The original Vaucher Duval hold mode was introduced solely to approximate a simulation application interaction with its event calendar.
An application is assumed to operate with a fixed number of initial events in the calendar. In operation, it deletes the earliest event from the calendar, synchronizes the simulation clock with this event scheduled time of occurrence, processes the event, and then inserts a newly scheduled event into the calendar.
begin
Field Summary | |
---|---|
(package private) java.lang.String |
alias
PEid and LPid of this LP, for debugging only |
(package private) int |
count
class member for keeping track of how many messages have been sent. |
(package private) int |
MsgPop
message population |
(package private) int |
numLPs
the number of LPs |
(package private) java.util.Random |
random
random number generator |
(package private) int |
timeIncrement
the time increment for messages sent by this LP; the message will be sent at currentTime+timeIncrement |
Fields inherited from class LogicalProcess |
---|
ALL_LPS, APPid, configData, currentTime, lastTime, LPid, myname, PEid, scheduler |
Constructor Summary | |
---|---|
Phold()
Constructs a new Phold instance. |
Method Summary | |
---|---|
void |
appFinalizeLP()
Terminates LP and displays simulation statistics. |
java.util.List<java.lang.String> |
appGetMonitorable()
Returns a List of Strings describing all application-specific monitorable parameters of this LP, each in the form "paramName, paramType". |
java.lang.String |
appGetState(java.lang.String name)
Method to get the value of a given application-level monitorable variable. |
java.util.List<java.lang.String> |
appGetSteerable()
Returns a List of Strings describing all application-specific steerable parameters of this LP, each in the form "paramName, paramType". |
boolean |
appInitializeLP()
Initiates the LP and generates the initial message. |
void |
appRunLP(java.lang.Object content,
java.lang.String sender)
Handles events for Phold. |
LogicalProcess |
appSavingLPState()
Implements abstract method to save LP state |
void |
appSetConfigData(java.lang.String cdata)
Sets application-specific configuration data. |
void |
appSetLPState(LogicalProcess lp)
Implements abstract method to set the state of this LP to the state of a specified Phold |
java.lang.String |
appSetState(java.lang.String name,
java.lang.String val)
Method to set the value of a given application-level monitorable variable. |
java.lang.String |
appToString()
Implements abstract method for dispaly purpose only |
(package private) double |
nextExponential(double u,
double lambda)
Returns a random number from exponential distributioin |
(package private) void |
tSleep(int tim)
|
Methods inherited from class LogicalProcess |
---|
finalizeLP, getAPPid, getCurrentTime, getLID, getMonitorable, getName, getPID, getState, getSteerable, initializeLP, rollback, runLP, savingLPState, sendSimMessage, sendSimMessage, setAppID, setConfigData, setEndOfSimFlag, setLID, setLPState, setName, setPID, setScheduler, setState, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
int count
int MsgPop
int numLPs
int timeIncrement
java.util.Random random
java.lang.String alias
Constructor Detail |
---|
public Phold()
Method Detail |
---|
public boolean appInitializeLP()
appInitializeLP
in class LogicalProcess
void tSleep(int tim)
public void appRunLP(java.lang.Object content, java.lang.String sender)
appRunLP
in class LogicalProcess
content
- an Object representing the content of the message to be sentsender
- String the application-assigned name of the sender of this messagepublic void appFinalizeLP()
appFinalizeLP
in class LogicalProcess
double nextExponential(double u, double lambda)
u
- double the random number from a uniform distributionlambda
- double the arrival ratepublic LogicalProcess appSavingLPState()
appSavingLPState
in class LogicalProcess
public void appSetLPState(LogicalProcess lp)
appSetLPState
in class LogicalProcess
lp
- LogicalProcess containing the state information; the application
program decides what state information need to be storedpublic void appSetConfigData(java.lang.String cdata)
appSetConfigData
in class LogicalProcess
cdata
- String representing configuration data.public java.lang.String appToString()
appToString
in class LogicalProcess
public java.lang.String appGetState(java.lang.String name)
appGetState
in class LogicalProcess
name
- The name of the variable to monitor
public java.lang.String appSetState(java.lang.String name, java.lang.String val)
appSetState
in class LogicalProcess
name
- The name of the variable to steerval
- The value to assign to the variable
public java.util.List<java.lang.String> appGetSteerable()
appGetSteerable
in class LogicalProcess
public java.util.List<java.lang.String> appGetMonitorable()
appGetMonitorable
in class LogicalProcess
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |