Class NetNode

Direct Known Subclasses:
Burst

public class NetNode extends SimEntity
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 Details

    • EXCEPTION_UNABLE_TO_BROADCAST

      public static final int EXCEPTION_UNABLE_TO_BROADCAST
      Unable to broadcast a message
      See Also:
    • EXCEPTION_MEASURE_DOES_NOT_EXIST

      public static final int EXCEPTION_MEASURE_DOES_NOT_EXIST
      Required measure does not exist
      See Also:
    • EXCEPTION_INPUT_SECTION_ALREADY_DEFINED

      public static final int EXCEPTION_INPUT_SECTION_ALREADY_DEFINED
      Input section has been already defined.
      See Also:
    • EXCEPTION_SERVICE_SECTION_ALREADY_DEFINED

      public static final int EXCEPTION_SERVICE_SECTION_ALREADY_DEFINED
      Service section has been already defined.
      See Also:
    • EXCEPTION_OUTPUT_SECTION_ALREADY_DEFINED

      public static final int EXCEPTION_OUTPUT_SECTION_ALREADY_DEFINED
      Output section has been already defined.
      See Also:
    • EXCEPTION_ENABLING_SECTION_ALREADY_DEFINED

      public static final int EXCEPTION_ENABLING_SECTION_ALREADY_DEFINED
      Enabling section has been already defined
      See Also:
    • EXCEPTION_PROPERTY_NOT_AVAILABLE

      public static final int EXCEPTION_PROPERTY_NOT_AVAILABLE
      Required property is not available
      See Also:
    • PROPERTY_ID_ARRIVING_JOBS

      public static final int PROPERTY_ID_ARRIVING_JOBS
      Property ID: number of jobs arriving at this node
      See Also:
    • PROPERTY_ID_DEPARTING_JOBS

      public static final int PROPERTY_ID_DEPARTING_JOBS
      Property ID: number of jobs departing from this node
      See Also:
    • PROPERTY_ID_RESIDENT_JOBS

      public static final int PROPERTY_ID_RESIDENT_JOBS
      Property ID: number of jobs inside this node
      See Also:
    • PROPERTY_ID_RESIDENCE_TIME

      public static final int PROPERTY_ID_RESIDENCE_TIME
      Property ID: residence time
      See Also:
    • logger

      protected JSimLogger logger
      A logger
    • network

      protected QueueNetwork network
      The QueueNetwork which this NetNode belong to.
    • inputSection

      protected NodeSection inputSection
      Input section of the NetNode.
    • serviceSection

      protected NodeSection serviceSection
      Service section of the NetNode.
    • outputSection

      protected NodeSection outputSection
      Output section of the NetNode.
  • Constructor Details

    • NetNode

      public NetNode(String name)
      Creates a new instance of NetNode.
      Parameters:
      name - Name of the NetNode.
  • Method Details

    • setServer

      public void setServer(Server server)
    • getServer

      public Server getServer()
    • addSection

      public void addSection(NodeSection section) throws NetException
      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

      public void connect(NetNode netNode)
      Connects the output of this netNode to the input of an another netNode.
      Parameters:
      netNode - netNode to be linked.
    • getJobInfoList

      public JobInfoList getJobInfoList()
      Gets the JobInfoList of this node.
    • getInputNodes

      public NodeList getInputNodes()
      Gets input nodes.
      Returns:
      Input nodes linked to this node.
    • getOutputNodes

      public NodeList getOutputNodes()
      Gets output nodes.
      Returns:
      Output nodes linked to this node.
    • getIntNodeProperty

      public int getIntNodeProperty(int Id) throws NetException
      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

      public int getIntNodeProperty(int Id, JobClass JobClass) throws NetException
      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

      public double getDoubleNodeProperty(int Id) throws NetException
      Gets a double type property of this node.
      Parameters:
      Id - Property identifier.
      Returns:
      Property value.
      Throws:
      NetException - if the property is not available.
    • getDoubleNodeProperty

      public double getDoubleNodeProperty(int Id, JobClass JobClass) throws NetException
      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

      public Object getObjectNodeProperty(int Id) throws NetException
      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

      public Object getObjectNodeProperty(int Id, JobClass JobClass) throws NetException
      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

      public NodeSection getSection(int Id) throws NetException
      Gets a section of the node.
      Parameters:
      Id - Section identifier (constants defined in NodeSection).
      Returns:
      Node section.
      Throws:
      NetException
    • getQueueNet

      public QueueNetwork getQueueNet()
      Gets the Network owner of this node.
      Returns:
      Value of property Network.
    • getGlobalJobInfoList

      public GlobalJobInfoList getGlobalJobInfoList()
    • analyze

      public void analyze(int measureName, JobClass jobClass, Measure measurement) throws NetException
      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 type
      serverTypeId - the server type id
      Throws:
      NetException
    • isRunning

      public boolean isRunning()
    • getJobClasses

      public JobClassList getJobClasses()
      Gets the list of the job classes of the owner queue network.
      Returns:
      Queue network job classes.
    • getClassCompatibilities

      public Boolean[][] getClassCompatibilities()
      Returns class compatibilities for specific node
    • getServerTypes

      public List<Server.ServerType> getServerTypes()
      Returns server types for specific node
    • receive

      protected void receive(NetMessage message)
      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

      public final void body()
      This method implements the body of a NetNode.
      Specified by:
      body in class SimEntity
    • dispatch

      protected void dispatch(NetMessage message) throws NetException
      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

      public boolean removeJobFromNodeJobsList(Job data)
      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

      public boolean removeJobFromNodeJobsListOnly(Job data)
      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

      public void start()
      Description copied from class: SimEntity
      Starts the activity of the SimEntity, call it the first time before calling execute.
      Specified by:
      start in class SimEntity
    • restart

      public void restart()
      Restarts the entity after an hold period: implements the method restart() of SimEntity.
      Specified by:
      restart in class SimEntity
    • poison

      public void poison()
      Description copied from class: SimEntity
      Changes the state of the entity into FINISHED.
      Overrides:
      poison in class SimEntity
    • 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

      public void setBlockingRegionInputStation(BlockingRegion region)
      Sets the blocking region input station.
      Parameters:
      region - The blocking region input station.
    • getBlockingRegionInputStation

      public BlockingRegion getBlockingRegionInputStation()
      Returns the blocking region input station.
      Returns:
      blocking region, only if this is a region input station.
    • getSimParameters

      public SimParameters getSimParameters()
      Returns the sim parameters.
      Returns:
      the simulation parameters.
    • setSimParameters

      public void setSimParameters(SimParameters simParameters)
      Sets the sim parameters.
      Parameters:
      simParameters - reads the simulation parameters.
    • initializeSections

      public void initializeSections() throws NetException
      This method is called after all the sections are added.
      Throws:
      NetException
    • getNetSystem

      public NetSystem getNetSystem()