Class NodeSection
java.lang.Object
QueueNet.NodeSection
- Direct Known Subclasses:
PipeSection
This class implements a generic section of a NetNode.
- Author:
- Francesco Radaelli, Stefano Omini
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intException ID: Required measure does not exist.static final intException ID: Required property is not available.static final byteInput section addressprotected JobInfoListprotected JSimLoggerstatic final intMessage passed has not been processed (general event).static final intMessage passed has been processed (all events).static final byteSection without address.static final byteOutput section address.static final intProperty ID: number of jobs arriving at this sectionstatic final intProperty ID: average utilizationstatic final intProperty ID: number of jobs departing from this sectionstatic final intProperty ID: residence timestatic final intProperty ID: number of jobs inside this sectionstatic final intProperty ID: utilizationstatic final byteService section address. -
Constructor Summary
ConstructorsConstructorDescriptionNodeSection(byte id) Creates a new instance of this NodeSection.NodeSection(byte id, boolean auto) Creates a new instance of this NodeSection.NodeSection(byte id, boolean auto, boolean nodeAuto) Creates a new instance of this NodeSection. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidAnalyzes a measure in the node section.voidanalyzeFCR(int name, Measure measurement) voidvoidanalyzeJoin(int name, JobClass jobClass, Measure measurement) voidanalyzeTransition(int name, String modeName, Measure measurement) Boolean[][]Returns class compatibilities for specific nodedoublegetDoubleSectionProperty(int id) Gets a double type property of this node.doublegetDoubleSectionProperty(int id, JobClass jobClass) Gets a double type property of this node depending on a specified job class.intgetIntSectionProperty(int id) Gets an integer type property of this node.intgetIntSectionProperty(int id, JobClass jobClass) Gets an integer type property of this node depending on a specified job class.Gets the list of the job classes of the owner queue network.Gets the job info list of this section.getObject(int id) Gets an object type property of this node.Gets an object type property of this node depending on a specified job class.Gets the owner node of this section.getParameter(int id) Gets a parameter type property of this node.getParameter(int id, JobClass jobClass) Gets a parameter type property of this node depending on a specified job class.byteGets the id of the node section.Returns server types for specific nodebooleanisEnabled(int id) Checks if a property of this node is enabled.booleanChecks if a property of this node is enabled depending on a specified job class.protected booleanisMine(NetMessage message) Checks if a message has been sent by this section.booleanisMyOwnerNode(NetNode node) Checks if the specified node is the owner node of this section.protected voidnodeLinked(NetNode node) This method should be overridden to implement a specific behaviour of the node section when the node section itself is linked to the owner node.protected abstract intprocess(NetMessage message) This method should be overridden to implement a specific NetMessage processor.protected RemoveTokenRedirects a job to a section of a node without updating measures.protected booleanremoveMessage(RemoveToken token) Removes a message previously sent.protected RemoveTokenSends an event to a section of this node.protected RemoveTokenSends an event to a section of a node.protected RemoveTokenSends an event to the input section of a node.protected RemoveTokenSends a job to a section of this node.protected RemoveTokenSends a job to a section of a node.protected RemoveTokenSends a job to the input section of a node.protected RemoveTokensendAckAfterDrop(Job job, double delay, byte destinationSection, NetNode destination) Sends an "ack" event to a section of a node to inform it that the job previously sent has been dropped.protected RemoveTokenSends an event to this section.protected RemoveTokenSends a job to this section.protected voidupdateVisitPath(Job job) Updates the visit path of this job.
-
Field Details
-
NO_ADDRESS
public static final byte NO_ADDRESSSection without address.- See Also:
-
INPUT
public static final byte INPUTInput section address- See Also:
-
SERVICE
public static final byte SERVICEService section address.- See Also:
-
OUTPUT
public static final byte OUTPUTOutput section address.- See Also:
-
MSG_NOT_PROCESSED
public static final int MSG_NOT_PROCESSEDMessage passed has not been processed (general event).- See Also:
-
MSG_PROCESSED
public static final int MSG_PROCESSEDMessage passed has been processed (all events).- See Also:
-
EXCEPTION_MEASURE_DOES_NOT_EXIST
public static final int EXCEPTION_MEASURE_DOES_NOT_EXISTException ID: Required measure does not exist.- See Also:
-
EXCEPTION_PROPERTY_NOT_AVAILABLE
public static final int EXCEPTION_PROPERTY_NOT_AVAILABLEException ID: Required 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 section- See Also:
-
PROPERTY_ID_DEPARTING_JOBS
public static final int PROPERTY_ID_DEPARTING_JOBSProperty ID: number of jobs departing from this section- See Also:
-
PROPERTY_ID_RESIDENT_JOBS
public static final int PROPERTY_ID_RESIDENT_JOBSProperty ID: number of jobs inside this section- See Also:
-
PROPERTY_ID_RESIDENCE_TIME
public static final int PROPERTY_ID_RESIDENCE_TIMEProperty ID: residence time- See Also:
-
PROPERTY_ID_UTILIZATION
public static final int PROPERTY_ID_UTILIZATIONProperty ID: utilization- See Also:
-
PROPERTY_ID_AVERAGE_UTILIZATION
public static final int PROPERTY_ID_AVERAGE_UTILIZATIONProperty ID: average utilization- See Also:
-
jobsList
-
logger
-
-
Constructor Details
-
NodeSection
public NodeSection(byte id) Creates a new instance of this NodeSection. Note that, while building a new node section, node owner informations are not available. To set node section properties depending on the owner node ones, the "nodeLiked(...)" protected method should be used.- Parameters:
id- NodeSection identifier.
-
NodeSection
public NodeSection(byte id, boolean auto) Creates a new instance of this NodeSection. Note that, while building a new node section, node owner informations are not available. To set node section properties depending on the owner node ones, the "nodeLiked(...)" protected method should be used.- Parameters:
id- NodeSection identifier.auto- Auto refresh of the jobsList attribute.
-
NodeSection
public NodeSection(byte id, boolean auto, boolean nodeAuto) Creates a new instance of this NodeSection. Note that, while building a new node section, node owner informations are not available. To set node section properties depending on the owner node ones, the "nodeLiked(...)" protected method should be used.- Parameters:
id- NodeSection identifier.auto- Auto refresh of the jobsList attribute.nodeAuto- Auto refresh the jobsList attribute at node level
-
-
Method Details
-
nodeLinked
This method should be overridden to implement a specific behaviour of the node section when the node section itself is linked to the owner node. This method should be used to set node section properties depending on the owner node ones.- Parameters:
node- Owner node.- Throws:
NetException
-
getSectionID
public byte getSectionID()Gets the id of the node section.- Returns:
- node section identifier.
-
analyze
- Throws:
NetException
-
analyze
public void analyze(int name, JobClass jobClass, Measure measurement, boolean isServerType, int serverTypeId) throws NetException Analyzes a measure in the node section. Override this method to analyze a measure depending on the node section implementation. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
name- name of the measure to be activated (see measures constants).jobClass- Job class to be analyzed.measurement- Set of measure to be activated.isServerType- the is server typeserverTypeId- the server type id- Throws:
NetException
-
getOwnerNode
-
isMyOwnerNode
Checks if the specified node is the owner node of this section. Note that this method could be called only after that the owner node has been linked to this section.- Parameters:
node- node to be checked.- Returns:
- True if the node is the owner node, false otherwise.
-
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 -
getJobInfoList
-
getIntSectionProperty
Gets an integer type property of this node. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier (see properties constants).- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getIntSectionProperty
Gets an integer type property of this node depending on a specified job class. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier (see properties constants).jobClass- jobClass.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getDoubleSectionProperty
Gets a double type property of this node. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier (see properties constants).- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getDoubleSectionProperty
Gets a double type property of this node depending on a specified job class. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier (see properties constants).jobClass- jobClass.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getParameter
Gets a parameter type property of this node. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getParameter
Gets a parameter type property of this node depending on a specified job class. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier.jobClass- jobClass.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getObject
Gets an object type property of this node. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
getObject
Gets an object type property of this node depending on a specified job class. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier.jobClass- the jobClass which property refers to.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
isEnabled
Checks if a property of this node is enabled. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
isEnabled
Checks if a property of this node is enabled depending on a specified job class. Note that the first 256 identifiers are reserved by NodeSection class.- Parameters:
id- Property identifier.jobClass- jobClass.- Returns:
- Property value.
- Throws:
NetException- if the requested property is not available.
-
process
protected abstract int process(NetMessage message) throws NetException, IncorrectDistributionParameterException This method should be overridden to implement a specific NetMessage processor.- Parameters:
message- message to be processed.- Returns:
- message processing result.
- Throws:
NetExceptionIncorrectDistributionParameterException
-
send
protected RemoveToken send(int event, Object data, double delay, byte destinationSection, NetNode destination) Sends an event to a section of a node.- Parameters:
event- event to be sent.data- data to be attached to the message.delay- Scheduling delay.destinationSection- destination section.destination- destination node.- Returns:
- a token to remove sent event.
-
send
Sends an event to the input section of a node.- Parameters:
event- event to be sent.data- data to be attached to the message.delay- Scheduling delay.destination- destination node.- Returns:
- a token to remove sent event.
-
send
Sends an event to a section of this node.- Parameters:
event- event to be sent.data- data to be attached to the message.delay- Scheduling delay.destinationSection- Destination section.- Returns:
- a token to remove sent event.
-
sendMe
Sends an event to this section.- Parameters:
event- event to be sent.data- data to be attached to the message.delay- Scheduling delay.- Returns:
- a token to remove sent event.
-
send
Sends a job to a section of a node.- Parameters:
job- job to be attached to the message.delay- Scheduling delay.destinationSection- destination section.destination- destination node.- Returns:
- a token to remove sent event.
-
send
Sends a job to the input section of a node.- Parameters:
job- job to be attached to the message.delay- Scheduling delay.destination- destination node.- Returns:
- a token to remove sent event.
-
send
Sends a job to a section of this node.- Parameters:
job- job to be attached to the message.delay- Scheduling delay.destinationSection- Destination section.- Returns:
- a token to remove sent event.
-
sendMe
Sends a job to this section.- Parameters:
job- job to be attached to the message.delay- Scheduling delay.- Returns:
- a token to remove sent event.
-
removeMessage
Removes a message previously sent.- Parameters:
token- the token to remove the message.- Returns:
- true if message was removed, false otherwise.
-
isMine
Checks if a message has been sent by this section. Note that this method could be called only after that the owner node has been linked to this section.- Parameters:
message- message to be checked.- Returns:
- True if the message has been sent by this section, false otherwise.
-
redirect
protected RemoveToken redirect(Job job, double delay, byte destinationSection, NetNode destination) throws NetException Redirects a job to a section of a node without updating measures.- Parameters:
job- job to be attached to the message.delay- Scheduling delay.destinationSection- destination section.destination- destination node.- Returns:
- a token to remove sent event.
- Throws:
NetException
-
sendAckAfterDrop
protected RemoveToken sendAckAfterDrop(Job job, double delay, byte destinationSection, NetNode destination) throws NetException Sends an "ack" event to a section of a node to inform it that the job previously sent has been dropped.- Parameters:
job- job to be attached to the message.delay- Scheduling delay.destinationSection- destination section.destination- destination node.- Returns:
- a token to remove sent event.
- Throws:
NetException
-
updateVisitPath
Updates the visit path of this job.- Parameters:
job- job whose visit path is to be updated.
-
analyzeJoin
- Throws:
NetException
-
analyzeFCR
- Throws:
NetException
-
analyzeFJ
- Throws:
NetException
-
analyzeTransition
- Throws:
NetException
-