Class Job

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class Job extends JComponent
Class for a job in the animation
Author:
Lorenzo Torri Date: 26-mar-2024 Time: 13.50
See Also:
  • Field Details

    • id

      public int id
    • serviceTime

      public double serviceTime
    • duration

      public double duration
    • service

      public DistributionJMCH service
    • maxValue

      public int maxValue
  • Constructor Details

  • Method Details

    • paint

      public void paint(Graphics g)
      This paint needs to know if we are on an edge or not, because if we are not on an edge, then we do not need to paint anything
      Overrides:
      paint in class JComponent
    • getPriority

      public int getPriority()
    • getColor

      public Color getColor()
    • getDuration

      public double getDuration()
    • getMapDuration

      public double getMapDuration()
    • isOnEdge

      public boolean isOnEdge()
    • setStartingPosition

      public void setStartingPosition(int x, int y, jmt.jmch.animation.Direction d, int finalPos)
      Method to set the staring point position of a job. It is called by an edge that have this new Job on its route.
      Parameters:
      x - x position of the Job
      y - y position of the Job
      d - direction of the movement
      finalPos - index of the array of edges of the next point
    • updatePosition

      public void updatePosition(double x, double y)
      Method to update the position of a moving job. It is different than the setStartingPoisition, since here we do not have to remove the circleSize/2 part
      Parameters:
      x - x position of the Job
      y - y position of the Job
    • getPosition

      public Point getPosition()
    • getCircleSize

      public int getCircleSize()
    • setDuration

      public void setDuration()
      Called once the Job is going outside of a station
    • getDirection

      public jmt.jmch.animation.Direction getDirection()
    • getFinalPos

      public int getFinalPos()
    • setDuration

      public void setDuration(double value)
      Called by the BoxStation in PS, to update the new duration of the job
    • setOnEdge

      public void setOnEdge()
    • unsetOnEdge

      public void unsetOnEdge()
    • getInterArrivalTime

      public double getInterArrivalTime()
    • getServiceTime

      public double getServiceTime()
    • getCumulatedService

      public double getCumulatedService()
    • getCumulatedResponseTime

      public double getCumulatedResponseTime()
    • updateCumulatedService

      public void updateCumulatedService(double speed, double interval)
    • setArrivalTime

      public void setArrivalTime(double arrivalT)
    • getArrivalTime

      public double getArrivalTime()
    • setIdServer

      public void setIdServer(int server)
    • getIdServer

      public int getIdServer()