/** * Allocates a new ResCloudlet object upon the arrival of a Cloudlet object. The arriving time * is determined by {@link gridsim.CloudSim#clock()}. * * @param cloudlet a cloudlet object * @see gridsim.CloudSim#clock() * @pre cloudlet != null * @post $none */ public ResCloudlet(Cloudlet cloudlet) { // when a new ResCloudlet is created, then it will automatically set // the submission time and other properties, such as remaining length this.cloudlet = cloudlet; startTime = 0; reservId = NOT_FOUND; duration = 0; init(); }
/** * Allocates a new ResCloudlet object upon the arrival of a Cloudlet object. Use this * constructor to store reserved Cloudlets, i.e. Cloudlets that done reservation before. The * arriving time is determined by {@link gridsim.CloudSim#clock()}. * * @param cloudlet a cloudlet object * @param startTime a reservation start time. Can also be interpreted as starting time to * execute this Cloudlet. * @param duration a reservation duration time. Can also be interpreted as how long to execute * this Cloudlet. * @param reservID a reservation ID that owns this Cloudlet * @see gridsim.CloudSim#clock() * @pre cloudlet != null * @pre startTime > 0 * @pre duration > 0 * @pre reservID > 0 * @post $none */ public ResCloudlet(Cloudlet cloudlet, long startTime, int duration, int reservID) { this.cloudlet = cloudlet; this.startTime = startTime; reservId = reservID; this.duration = duration; init(); }