Class Place

All Implemented Interfaces:
Serializable, Cloneable, Copyable

public class Place extends Station implements Serializable
A place within a stochastic Petri net / queueing Petri net model.

By default a Place is an ordinary place (tokens are immediately available to the output transitions, modelled by a ServiceTunnel pass-through server). When a service process is assigned via setService(JobClass, Distribution), the place becomes a queueing place (QPN semantics): incoming tokens are served in an embedded queue under the place's scheduling strategy and, on completion, move to a depository from which they become available to the output transitions according to the departure discipline.

See Also:
  • Field Details

    • schedStrategies

      protected HashMap<JobClass,SchedStrategy> schedStrategies
    • queueing

      protected boolean queueing
      True once a service process has been assigned, i.e. this is a queueing place.
    • serviceProcesses

      protected HashMap<JobClass,Distribution> serviceProcesses
      Per-class service (queue) processes of the embedded queue; empty for ordinary places.
    • departureDiscipline

      protected HashMap<JobClass,DepartureDiscipline> departureDiscipline
      Per-class departure discipline of the depository.
    • fluid

      protected boolean fluid
      True if this is a FLUID place (FSPN): one real level, no tokens.
    • fluidCapacity

      protected double fluidCapacity
      Fluid capacity B of a fluid place, infinite when unbounded.
    • fluidLevel

      protected double fluidLevel
      Initial fluid level of a fluid place.
  • Constructor Details

  • Method Details

    • init

      public void init()
    • setClassCapacity

      public void setClassCapacity(JobClass jobclass, int capacity)
      Description copied from class: Station
      Alias of Station.setClassCap(jline.lang.JobClass, int), under the name the other three codebases use: MATLAB setClassCapacity, native Python set_class_capacity/setClassCapacity and C++ set_class_capacity. Kept so a model ported across them does not have to rename this one call.
      Overrides:
      setClassCapacity in class Station
      Parameters:
      jobclass - the job class to set capacity for
      capacity - the maximum number of jobs of this class
    • setSchedStrategy

      public void setSchedStrategy(JobClass jobClass, SchedStrategy strategy)
    • setService

      public void setService(JobClass jobClass, Distribution distribution)
      Assigns a service process to a token color, turning this ordinary place into a queueing place. The embedded queue serves tokens under the place's scheduling strategy; the first such call installs the concrete server section for that strategy.
      Overrides:
      setService in class ServiceNode
      Parameters:
      jobClass - the token color (job class)
      distribution - the service-time distribution of the embedded queue for this color
    • installQueueServer

      protected void installQueueServer()
      Installs the concrete server section matching the place's scheduling strategy, replacing the default ServiceTunnel pass-through used by ordinary places.
    • isQueueing

      public boolean isQueueing()
      Returns:
      true if this place is a queueing place (has an embedded queue).
    • getService

      public Distribution getService(JobClass jobClass)
    • setDepartureDiscipline

      public void setDepartureDiscipline(JobClass jobClass, DepartureDiscipline discipline)
    • getDepartureDiscipline

      public DepartureDiscipline getDepartureDiscipline(JobClass jobClass)
    • setFluid

      public void setFluid(boolean isFluid)
      Declares a FLUID place (Fluid Stochastic Petri Net): the place holds one real-valued level in [0, fluidCapacity] instead of a token count per class. Fluid moves only through Transition.setFluidRate(jline.lang.Mode, jline.lang.nodes.Place, double) (a flow while a mode runs) and Transition.setFluidImpulse(jline.lang.Mode, jline.lang.nodes.Place, double) (a jump on firing), and is read by Transition.setFluidGuard(jline.lang.Mode, jline.lang.nodes.Place, java.lang.String, double) and Transition.setFluidRateDependence(jline.lang.Mode, jline.lang.nodes.Place, jline.util.SerializableFunction<java.lang.Double, java.lang.Double>). Token arcs into or out of a fluid place are refused by the solvers.
      Parameters:
      isFluid - true to make this a fluid place
    • setFluid

      public void setFluid()
      Declares this a fluid place; see setFluid(boolean).
    • isFluid

      public boolean isFluid()
      Returns:
      true if this is a fluid place
    • setFluidCapacity

      public void setFluidCapacity(double capacity)
      Upper bound B of a fluid place. Inflow that would push the level past B is lost, as a token deposit past a place capacity is.
      Parameters:
      capacity - a positive capacity, or Double.POSITIVE_INFINITY for an unbounded place
    • getFluidCapacity

      public double getFluidCapacity()
      Returns:
      the fluid capacity, infinite when unbounded
    • setFluidLevel

      public void setFluidLevel(double level)
      Initial fluid level of a fluid place.
      Parameters:
      level - a finite non-negative level
    • getFluidLevel

      public double getFluidLevel()
      Returns:
      the initial fluid level
    • setNumberOfServers

      public void setNumberOfServers(int numberOfServers)
      Description copied from class: Station
      Sets the number of servers at this station.
      Overrides:
      setNumberOfServers in class Station
      Parameters:
      numberOfServers - the number of servers (use Integer.MAX_VALUE for infinite servers)
    • setMarking

      public void setMarking(int marking)
      Alias for StatefulNode.setState(int) using Petri-net terminology: sets the initial token marking of this place.
      Parameters:
      marking - initial number of tokens
    • setMarking

      public void setMarking(Matrix marking)
      Alias for StatefulNode.setState(jline.util.matrix.Matrix) using Petri-net terminology: sets the initial per-class token marking of this place.
      Parameters:
      marking - initial token counts per class