Class NetNode
java.lang.Object
simEngine.SimEntity
QueueNet.NetNode
- Direct Known Subclasses:
Burst
This class implements a generic QueueNetwork node.
- Author:
- Francesco Radaelli, Stefano Omini, Marco Bertoli Modified by Ashanka (May 2010): Patch: Multi-Sink Perf. Index Description: Added new Performance index for capturing 1. global response time (ResponseTime per Sink) 2. global throughput (Throughput per Sink) each sink per class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intEnabling section has been already definedstatic final intInput section has been already defined.static final intRequired measure does not existstatic final intOutput section has been already defined.static final intRequired property is not availablestatic final intService section has been already defined.static final intUnable to broadcast a messageprotected NodeSectionInput section of the NetNode.protected JSimLoggerA loggerprotected QueueNetworkThe QueueNetwork which this NetNode belong to.protected NodeSectionOutput section of the NetNode.static final intProperty ID: number of jobs arriving at this nodestatic final intProperty ID: number of jobs departing from this nodestatic final intProperty ID: residence timestatic final intProperty ID: number of jobs inside this nodeprotected NodeSectionService section of the NetNode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSection(NodeSection section) Adds a section to the node.voidvoidanalyze(int measureName, JobClass jobClass, Measure measurement, boolean isServerType, int serverTypeId) Analyzes a measure in the node.final voidbody()This method implements the body of a NetNode.voidConnects the output of this netNode to the input of an another netNode.protected voiddispatch(NetMessage message) This method should be overridden to implement an own dispatch.Returns the blocking region input station.Boolean[][]Returns class compatibilities for specific nodedoublegetDoubleNodeProperty(int Id) Gets a double type property of this node.doublegetDoubleNodeProperty(int Id, JobClass JobClass) Gets a double type property of this node related to a specified job class.Gets input nodes.intgetIntNodeProperty(int Id) Gets an integer type property related to this node.intgetIntNodeProperty(int Id, JobClass JobClass) Gets an integer type property of this node related to a specified job class.Gets the list of the job classes of the owner queue network.Gets the JobInfoList of this node.getObjectNodeProperty(int Id) Gets a generic object type property of this node.getObjectNodeProperty(int Id, JobClass JobClass) Gets a generic object type property of this node related to a specified job class.Gets output nodes.Gets the Network owner of this node.getSection(int Id) Gets a section of the node.Returns server types for specific nodeReturns the sim parameters.voidThis method is called after all the sections are added.booleanChecks whether blocking region input station.booleanbooleanisSink()Returns true if this NetNode is a sink.voidpoison()Changes the state of the entity into FINISHED.protected voidreceive(NetMessage message) Gets the first NetMessage in the queue which validates a specific predicate.booleanremoveJobFromNodeJobsList(Job data) Helper function to remove job from the NodeJobsListbooleanHelper function to remove job from the NodeJobsListvoidrestart()Restarts the entity after an hold period: implements the method restart() of SimEntity.voidSets the blocking region input station.voidvoidsetSimParameters(SimParameters simParameters) Sets the sim parameters.voidstart()Starts the activity of the SimEntity, call it the first time before calling execute.Methods inherited from class SimEntity
getEvbuf, getId, getName, getWaitingPred, setSimSystem, simCancel, simCurrent, simGetNext, simGetNext, simHold, simHoldFor, simPutback, simSchedule, simSchedule, simSelect, simUnschedule, simWait, simWaitFor, simWaiting, simWaiting
-
Field Details
-
EXCEPTION_UNABLE_TO_BROADCAST
public static final int EXCEPTION_UNABLE_TO_BROADCASTUnable to broadcast a message- See Also:
-
EXCEPTION_MEASURE_DOES_NOT_EXIST
public static final int EXCEPTION_MEASURE_DOES_NOT_EXISTRequired measure does not exist- See Also:
-
EXCEPTION_INPUT_SECTION_ALREADY_DEFINED
public static final int EXCEPTION_INPUT_SECTION_ALREADY_DEFINEDInput section has been already defined.- See Also:
-
EXCEPTION_SERVICE_SECTION_ALREADY_DEFINED
public static final int EXCEPTION_SERVICE_SECTION_ALREADY_DEFINEDService section has been already defined.- See Also:
-
EXCEPTION_OUTPUT_SECTION_ALREADY_DEFINED
public static final int EXCEPTION_OUTPUT_SECTION_ALREADY_DEFINEDOutput section has been already defined.- See Also:
-
EXCEPTION_ENABLING_SECTION_ALREADY_DEFINED
public static final int EXCEPTION_ENABLING_SECTION_ALREADY_DEFINEDEnabling section has been already defined- See Also:
-
EXCEPTION_PROPERTY_NOT_AVAILABLE
public static final int EXCEPTION_PROPERTY_NOT_AVAILABLERequired property is not available- See Also:
-
PROPERTY_ID_ARRIVING_JOBS
public static final int PROPERTY_ID_ARRIVING_JOBSProperty ID: number of jobs arriving at this node- See Also:
-
PROPERTY_ID_DEPARTING_JOBS
public static final int PROPERTY_ID_DEPARTING_JOBSProperty ID: number of jobs departing from this node- See Also:
-
PROPERTY_ID_RESIDENT_JOBS
public static final int PROPERTY_ID_RESIDENT_JOBSProperty ID: number of jobs inside this node- See Also:
-
PROPERTY_ID_RESIDENCE_TIME
public static final int PROPERTY_ID_RESIDENCE_TIMEProperty ID: residence time- See Also:
-
logger
A logger -
network
The QueueNetwork which this NetNode belong to. -
inputSection
Input section of the NetNode. -
serviceSection
Service section of the NetNode. -
outputSection
Output section of the NetNode.
-
-
Constructor Details
-
NetNode
Creates a new instance of NetNode.- Parameters:
name- Name of the NetNode.
-
-
Method Details
-
setServer
-
getServer
-
addSection
Adds a section to the node.- Parameters:
section- Reference to the section to be added.- Throws:
NetException- if the section has already been defined.
-
connect
Connects the output of this netNode to the input of an another netNode.- Parameters:
netNode- netNode to be linked.
-
getJobInfoList
Gets the JobInfoList of this node. -
getInputNodes
-
getOutputNodes
-
getIntNodeProperty
Gets an integer type property related to this node.- Parameters:
Id- Property identifier.- Returns:
- Property value.
- Throws:
NetException- if the property is not available.
-
getIntNodeProperty
Gets an integer type property of this node related to a specified job class.- Parameters:
Id- Property identifier.JobClass- JobClass.- Returns:
- Property value.
- Throws:
NetException- if the property is not available.
-
getDoubleNodeProperty
Gets a double type property of this node.- Parameters:
Id- Property identifier.- Returns:
- Property value.
- Throws:
NetException- if the property is not available.
-
getDoubleNodeProperty
Gets a double type property of this node related to a specified job class.- Parameters:
Id- Property identifier.JobClass- JobClass.- Returns:
- Property value.
- Throws:
NetException- if the property is not available.
-
getObjectNodeProperty
Gets a generic object type property of this node.- Parameters:
Id- Property identifier.- Returns:
- Property value.
- Throws:
NetException- if the property is not available.
-
getObjectNodeProperty
Gets a generic object type property of this node related to a specified job class.- Parameters:
Id- Property identifier.JobClass- JobClass.- Returns:
- Property value.
- Throws:
NetException- if the property is not available.
-
getSection
Gets a section of the node.- Parameters:
Id- Section identifier (constants defined in NodeSection).- Returns:
- Node section.
- Throws:
NetException
-
getQueueNet
Gets the Network owner of this node.- Returns:
- Value of property Network.
-
getGlobalJobInfoList
-
analyze
- Throws:
NetException
-
analyze
public void analyze(int measureName, JobClass jobClass, Measure measurement, boolean isServerType, int serverTypeId) throws NetException Analyzes a measure in the node.- Parameters:
measureName- name of the measure to be activated.jobClass- Job class to be analyzed.measurement- measure to be activated.isServerType- the is server typeserverTypeId- the server type id- Throws:
NetException
-
isRunning
public boolean isRunning() -
getJobClasses
Gets the list of the job classes of the owner queue network.- Returns:
- Queue network job classes.
-
getClassCompatibilities
Returns class compatibilities for specific node -
getServerTypes
Returns server types for specific node -
receive
Gets the first NetMessage in the queue which validates a specific predicate.- Parameters:
message- Reference to a NetMessage buffer to be filled with the message information.
-
body
-
dispatch
This method should be overridden to implement an own dispatch. This method implements the events dispacther of the NetNode; it should never remains busy for a long time. Remember to call the superclass dispatch method if you want to inherit all the superclass handled events.- Throws:
NetException
-
removeJobFromNodeJobsList
Helper function to remove job from the NodeJobsList- Parameters:
data- the jobInfo data looking to be removed.- Returns:
- true if the operation is successful, false otherwise
-
removeJobFromNodeJobsListOnly
Helper function to remove job from the NodeJobsList- Parameters:
data- the jobInfo data looking to be removed.- Returns:
- true if the operation is successful, false otherwise
-
start
-
restart
-
poison
-
isSink
public boolean isSink()Returns true if this NetNode is a sink. This is extremely useful as sinks does not have service section and output section, causing a lot of null pointer exception in routing strategies if not treated correctly. Author: Bertoli Marco- Returns:
- true if this node does not have service section and output section.
-
isBlockingRegionInputStation
public boolean isBlockingRegionInputStation()Checks whether blocking region input station.- Returns:
- true if this is a blocking region input station.
-
setBlockingRegionInputStation
Sets the blocking region input station.- Parameters:
region- The blocking region input station.
-
getBlockingRegionInputStation
Returns the blocking region input station.- Returns:
- blocking region, only if this is a region input station.
-
getSimParameters
Returns the sim parameters.- Returns:
- the simulation parameters.
-
setSimParameters
Sets the sim parameters.- Parameters:
simParameters- reads the simulation parameters.
-
initializeSections
This method is called after all the sections are added.- Throws:
NetException
-
getNetSystem
-