public abstract class Truck extends ExternalTransporter
ExternalTransporter
which arrives at a container
terminal to deliver and /or pick up one some containers (goods). It has a
certain number of import/export containers that must have loaded/unloaded
before it can leave a container terminal. The both numbers must be not
negative. It also has a certain speed that he drives in a container terminal
with. the speed must be not negative or zero. Truck is derived from
ExternalTrasnporter. Its lifeCycle()
must be implemented by
the user in order to specify the behavior of the Truck.ExternalTransporter
Constructor and Description |
---|
Truck(Model owner,
java.lang.String name,
long nImportGoods,
long nExportGoods,
double speed,
boolean showInTrace)
Constructs a Truck which arrives at a container terminal to deliver
and/or pick up some containers (goods).
|
Modifier and Type | Method and Description |
---|---|
void |
drive(double distance)
This method describes the driving of the certain distance of this Truck.
|
double |
getDrivingTime()
Returns the whole time of this Truck he has driven.
|
Lane |
getLane()
Returns the current lane this Truck stands in by the HO.
|
double |
getSpeed()
Returns the speed of this Truck he drives with.
|
void |
setLane(Lane l)
Sets the lane where the truck waits by the holding area.
|
void |
setSpeed(double s)
Sets the speed of this Truck it drives with. to a new value.
|
getNumberOfExportGoods, getNumberOfImportGoods, setNumberOfExportGoods, setNumberOfImportGoods
activate, activate, activate, activateAfter, activateBefore, activatePreempt, cancelInterruptDelayed, canCooperate, clearInterruptCode, cooperate, getActivatedBy, getInterruptCode, getInterruptException, getMaster, getRealTimeConstraint, getSchedulingPriority, getSlaveWaitQueue, getSupervisor, hold, hold, hold, interrupt, interrupt, interruptDelayed, interruptDelayed, isBlocked, isComponent, isDelayedInterruptScheduled, isInterrupted, isRepeating, isTerminated, lifeCycle, obtainResources, passivate, prepareTransport, reActivate, reActivate, resetMaster, returnAllResources, returnResources, setBlocked, setRealTimeConstraint, setRepeating, setSchedulingPriority, setSlaveWaitQueue
getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority
assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, rename, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public Truck(Model owner, java.lang.String name, long nImportGoods, long nExportGoods, double speed, boolean showInTrace)
lifeCycle()
method to specify its behavior. A Truck has a
number of import/export containers that must have loaded/unloaded before
it can leave a container terminal. Both must not be negative. Their
default value is one. A Truck has also a certain speed that he drives in
a container terminal with.owner
- desmoj.Model : The model this Truck is associated to.name
- java.lang.String : The name of this Truck.nImportGoods
- long : The number of import goods this Truck has to pick up
from a container terminal.nExportGoods
- long : The number of export goods this Truck delivers to a
container terminal.speed
- double : The speed of this Truck.showInTrace
- boolean : Flag, if this Truck should produce a trace output or
not.public double getSpeed()
public void setSpeed(double s)
s
- double : The new speed of this Truck.public void drive(double distance) throws SuspendExecution
distance
- double : The distance to drive.SuspendExecution
public double getDrivingTime()
public void setLane(Lane l)
l
- Lane
: The new lane of this Truck.public Lane getLane()
Lane
: The lane of this Truck.