package nl.tudelft.simulation.examples.dsol.timesharedcomputer; import nl.tudelft.simulation.dsol.formalisms.flow.StationInterface; import nl.tudelft.simulation.jstats.distributions.DistContinuous; /** * The Computer job as published in Simulation Modeling and Analysis by A.M. Law & W.D. Kelton section 1.4 and 2.4.
* Copyright (c) 2003-2019 Delft University of Technology , the Netherlands.
* See for project information www.simulation.tudelft.nl
* License of use: General Public License (GPL) , no warranty
* @author Peter Jacobs */ public class Job { /** arrivalTime refers to the time when the job arrived at the cpu. */ private double creationTime = Double.NaN; /** serviceTime refers to the handling or service time of the job. */ private double serviceTime = Double.NaN; /** source refers to the source of the job. */ private StationInterface source; /** * constructs a new Job. * @param serviceTimeDistribution DistContinuous; the distribution from which to draw the serviceTime * @param source StationInterface; the source of the job * @param creationTime double; time of creation */ public Job(final DistContinuous serviceTimeDistribution, final StationInterface source, final double creationTime) { this.source = source; this.serviceTime = serviceTimeDistribution.draw(); this.creationTime = creationTime; } /** * gets the creationTime of the Job * @return double the time of creation */ public double getCreationTime() { return this.creationTime; } /** * returns the serviceTime * @return double the time */ public double getServiceTime() { return this.serviceTime; } /** * sets the serviceTime * @param serviceTime double; the time */ public void setServiceTime(final double serviceTime) { this.serviceTime = serviceTime; } /** * returns the source * @return StationInterface the owning terminal */ public StationInterface getOwner() { return this.source; } }