- All Implemented Interfaces:
Graph.Graphic
,NamedObjectOps
dφ/ds = - (sin (φ - θt)) / L
The angle θt can be computed using the
BasicSplinePath2D
methods
BasicSplinePath2D.dxDu(double)
and
BasicSplinePath2D.dyDu(double)
together
with Math.atan2(double,double)
, with u determined
by the BasicSplinePath2D
method
u(s)
.
To have the vehicle oriented so that it
moves backwards with increasing values of s, the differential
equation is
dφ/ds = (sin (φ - θt))/L
and again the sign will change if the vehicle is moving in the direction of decreasing s.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTo
(Graph graph, Graphics2D g2d, Graphics2D g2dGcS) boolean
void
protected Object
clone()
void
configure
(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color) Initialize the Car.void
configure
(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color, double doorLength, double doorWidth) Initialize the Car, specifying door dimensions.void
configure
(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color, Color windshieldColor) Initialize the object, also specifying a color for the windshield.void
configure
(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color, Color windshieldColor, double doorLength, double doorWidth) Initialize the object, also specifying a color for the windshield.final boolean
delete()
final boolean
Get the color used to display a blind spot.getColor()
Get the color of the vehicle.double
Get the length of a door.double
Get the width of a door.double
Get the horizontal distance to the driver from the top of the windshield.double
Return the X coordinate of a driver's position in graph coordinate space.double
Get the distance to the driver from the left side of the car.double
Return the Y coordinate of a driver's position in graph coordinate space.double
Get the length of the hood.double
Get the left blind-spot angle.double
Get the left blind-spot angular extent.double
Get the left blind-spot length.double
Get the left blind-spot offset.boolean
Determine if the left blind spot should be displayed.double
Get the maximum angle for the left door when open.boolean
Get the left-door mode.double
Get the angular rate at which the left door moves.double
Get the length of the vehicle.Get the string to display when setLooking is given the argument 'true'.final String
getName()
protected Simulation
double
Get the distance from the rear of the vehicle to the rear wheels.boolean
Determine if reverse mode is turned on.double
Get the right blind-spot angle.double
Get the right blind-spot angular extent.double
Get the right blind-spot length.double
Get the right blind-spot offset.boolean
Determine if the right blind spot should be displayed.double
Get the maximum angle for the right door when open.boolean
Get the right-door mode.double
Get the angular rate at which the right door moves.boolean
Determine if skid mode is turned on.double
getWidth()
Get the width of the vehicle.Get the color of the windshield.double
Get the length of the windshield.final boolean
boolean
void
printConfiguration
(String iPrefix, String prefix, boolean printName, PrintWriter out) Print the configuration for an instance of Car.void
printState
(String iPrefix, String prefix, boolean printName, PrintWriter out) Print the state for an instance of Car.void
Set the blind spot color.void
setDriverPosition
(double x, double y) Set the position of the driver.void
setDriverX
(double x) Set the X coordinate of the driver.void
setDriverY
(double y) Set the Y coordinate of the driver.void
setLeftBlindSpotExtent
(double phiLeft) Set the left blind spot angular extent.void
setLeftBlindSpotLength
(double leftLength) Set the length of the left blind spot as displayed.void
setLeftBlindSpotOffset
(double offset) Set the left blind-spot offset.void
setLeftBlindSpotVisible
(boolean visibility) Set whether or not the left blind spot is displayed.void
setLeftDoorMaxAngle
(double angle) Set the maximum door angle for the left door.void
setLeftDoorMode
(boolean mode) Set the mode for the door.void
setLeftDoorRate
(double angularSpeed) Set the angular speed (absolute value of the angular velocity) at which a door opens or closes.void
setLookAngle
(double angle) Set the angle the driver looks relative to the car An angle of zero points in the direction in which the car is pointed, and angles are measured counterclockwise in radiansvoid
setLooking
(boolean value) Set whether or not the word "Look", or the value provided by the method setLookString, should be displayed in front of the driver's location.void
setLookParams
(Color color) Set the font color for a "looking" indication.void
setLookString
(String string) Set the string to display when setLooking is given the argument 'true'.void
void
protected void
setPathImplementation
(BasicSplinePath2D path, double u0, double angle, boolean angleRelative, double time0) Set a path for this object to follow, specifying an initial path parameter and angle.void
setRefPoint
(double x, double y) void
setRefPointByFraction
(double xf, double yf) void
void
setReverseMode
(boolean reverse) Set reverse mode on or off.void
setRightBlindSpotExtent
(double phiRight) Set the right blind spot angular extent.void
setRightBlindSpotLength
(double rightLength) Set the length of the left blind spot as displayed.void
setRightBlindSpotOffset
(double offset) Set the right blind-spot offset.void
setRightBlindSpotVisible
(boolean visibility) Set whether or not the right blind spot is displayed.void
setRightDoorMaxAngle
(double angle) Set the maximum door angle for the right door.void
setRightDoorMode
(boolean mode) Set the mode for the door.void
setRightDoorRate
(double angularSpeed) Set the angular speed (absolute value of the angular velocity) at which a door opens or closes.void
setSkidMode
(boolean mode) Set skid mode on or off.protected void
update
(double t, long simtime) Methods inherited from class org.bzdev.anim2d.DirectedObject2D
angleIsRelative, defaultAngleRelative, getAngularVelocity, getDistance, getInitialPathTime, getInitialS, getInitialU, getMaxPathParameter, getPathAcceleration, getPathAngle, getPathDxDu, getPathDyDu, getPathInversionLimit, getPathLength, getPathLength, getPathVelocity, getPathX, getPathY, getS, getS, getU, getU, getUpdatedTime, hasPath, isClosedPath, pathExists, setAngle, setAngleByF, setAngleBySF, setAngleRelative, setAngularAcceleration, setAngularVelocity, setDistanceByF, setDistanceBySF, setPath, setPath, setPath, setPath, setPath, setPath, setPath, setPath, setPathAcceleration, setPathAngle, setPathAngularAcceleration, setPathAngularVelocity, setPathInversionLimit, setPathVelocity, setPosition
Methods inherited from class org.bzdev.anim2d.PlacedAnimationObject2D
getAddToTransform, getAngle, getBBXMax, getBBXMin, getBBYMax, getBBYMin, getReferencePointX, getReferencePointY, getRefPointName, getX, getY, setPosition, setRefPoint, setRefPointBounds, setRefPointBounds
Methods inherited from class org.bzdev.anim2d.AnimationObject2D
addToFrame, addToFrame, getAnimation, getZorder, isVisible, setVisible, setZorder, setZorder
Methods inherited from class org.bzdev.devqsim.SimObject
addSimulationListener, addTraceSet, bindCallable, bindCallable, bindCallable, bindCallable, bindRunnable, bindRunnable, bindRunnable, bindRunnable, callableObject, callableScript, callScriptFunction, callScriptMethod, clearTraceSets, evalScript, getEventListenerList, getScriptObject, getTraceSets, onDelete, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printState, printState, printState, printState, printState, printState, putScriptObject, removeSimulationListener, removeTraceSet, runnableObject, runnableScript, scheduleCall, scheduleCall, scheduleCall, scheduleCall, scheduleCallObject, scheduleScript, scheduleTask, scheduleTask, scheduleTask, scheduleTask, scheduleTaskObject, scheduleTaskScript, startImmediateTask, startImmediateTask, trace, trace, unscheduledTaskThread, unscheduledTaskThread, update, usesTraceSet
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bzdev.graphs.Graph.Graphic
boundingBox
Methods inherited from interface org.bzdev.obnaming.NamedObjectOps
canDelete, delete, deletePending, getName, isDeleted, isInterned
-
Constructor Details
-
Car
Constructor.- Parameters:
a2d
- the animationname
- the name of this objectintern
- true if the object is interned in the animation's name space; false otherwise.
-
-
Method Details
-
getLength
public double getLength()Get the length of the vehicle.- Returns:
- the length of the vehicle in meters
-
getWidth
public double getWidth()Get the width of the vehicle.- Returns:
- the width of the vehicle in meters
-
getHoodLength
public double getHoodLength()Get the length of the hood.- Returns:
- the length of the hood in meters
-
getWindshieldLength
public double getWindshieldLength()Get the length of the windshield. The length is measure horizontally along the vehicle's axis (parallel to its direction of motion when moving in a straight line).- Returns:
- the length of the windshield in meters
-
getRearOffset
public double getRearOffset()Get the distance from the rear of the vehicle to the rear wheels.- Returns:
- the distance from the rear of the vehicle to the rear wheels in meters
-
getDoorLength
public double getDoorLength()Get the length of a door.- Returns:
- the length of the door
-
getDoorWidth
public double getDoorWidth()Get the width of a door.- Returns:
- the width of a door.
-
getColor
Get the color of the vehicle.- Returns:
- the color of the vehicle
-
getWindshieldColor
Get the color of the windshield. The default is Color.WHITE, but in some cases it is useful to change it (e.g., for a white vehicle).- Returns:
- the color of the windshield
-
setSkidMode
public void setSkidMode(boolean mode) Set skid mode on or off. When skid mode is off (the default), an angle function is used that will prevent the car from "fishtailing" as it follows a path. Otherwise the angle the car makes with a path is determined by a user-specified angle function, or alternatively an angular velocity and angular acceleration, and whether the angle is absolute or relative (seeDirectedObject2D.setAngleRelative(boolean)
).- Parameters:
mode
- true if skid mode is on; false if it is off
-
getSkidMode
public boolean getSkidMode()Determine if skid mode is turned on.- Returns:
- true of skid mode is in effect; false otherwise
-
setReverseMode
public void setReverseMode(boolean reverse) Set reverse mode on or off. When reverse mode is on, and one of the car's setPath methods is called with the relative-angle flag set to true (the default for a car), the car's angle will be flipped by 180 degrees. In the case where the angle (relative to the tangent) is 0, the rear of the car will point in the same direction as the path's tangent vector.This method should not be called after setPath is called and before the car reaches its final point along the path: otherwise the behavior may be erratic.
- Parameters:
reverse
- true to turn reverse mode on; false to turn it off.
-
getReverseMode
public boolean getReverseMode()Determine if reverse mode is turned on. When reverse mode is on, and one of the car's setPath methods is called with the relative-angle flag set to true (the default for a car), the car's angle will be flipped by 180 degrees. In the case where the angle (relative to the tangent) is 0, the rear of the car will point in the same direction as the path's tangent vector.- Returns:
- true if reverse mode is in effect; false otherwise.
-
update
protected void update(double t, long simtime) - Overrides:
update
in classDirectedObject2D
-
setPathImplementation
protected void setPathImplementation(BasicSplinePath2D path, double u0, double angle, boolean angleRelative, double time0) Set a path for this object to follow, specifying an initial path parameter and angle. The object's position will held at the start of the path until the object's time passes time0. The object's angle will match that of a tangent to the path at the object's reference point's current location. The path angle function will be set to null, as will the corresponding simulation function. If one is desired, it should be reset after setPath is called.Skid mode is recognized by this method. The implementation for skid mode installs a path-angle function, but keeps a copy of the previous one and restores it when skid mode is turned off. This method sets the saved value to null as the normal behavior of this method is to set the path angle function to null. A path simulation function is treated similarly.
Subclasses that modify how paths are processed should override this method and in most cases call super.setPathImplementation and, of course, document any changes in behavior.
- Overrides:
setPathImplementation
in classDirectedObject2D
- Parameters:
path
- the path the object will followu0
- the path's parameter at a time equal to time0angle
- the initial angleangleRelative
- true if the angle is measured relative to path's tangent; false if the angle is absolutetime0
- the increment from the current time at which the object starts moving along the path
-
clearPath
public void clearPath()- Overrides:
clearPath
in classDirectedObject2D
-
configure
public void configure(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color) throws IllegalStateException Initialize the Car. All lengths are measured on a two-dimensional surface so that for any component (e.g., a windshield) that is slanted vertically, the length of the projection onto the x-y plane must be used. The door widths and lengths are set to zero to indicate that default values should be used.- Parameters:
length
- the length of the car in meterswidth
- the width of the car in metershoodLength
- the length of the hood in meterswindshieldLength
- length the length of the windshield in meters (measured horizontally)rearOffset
- distance from the rear of the car to the rear wheelscolor
- the color of the car- Throws:
IllegalStateException
- attempt to change parameters after the car was configured
-
configure
public void configure(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color, double doorLength, double doorWidth) throws IllegalStateException Initialize the Car, specifying door dimensions. All lengths are measured on a two-dimensional surface so that for any component (e.g., a windshield) that is slanted vertically, the length of the projection onto the x-y plane must be used.- Parameters:
length
- the length of the car in meterswidth
- the width of the car in metershoodLength
- the length of the hood in meterswindshieldLength
- length the length of the windshield in meters (measured horizontally)rearOffset
- distance from the rear of the car to the rear wheelscolor
- the color of the cardoorLength
- the length of the door in metersdoorWidth
- the width (thickness) of the door in meters- Throws:
IllegalStateException
- attempt to change parameters after the car was configured
-
configure
public void configure(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color, Color windshieldColor) throws IllegalStateException Initialize the object, also specifying a color for the windshield. All lengths are measured on a two-dimensional surface so that for any component (e.g., a windshield) that is slanted vertically, the length of the projection onto the x-y plane must be used.- Parameters:
length
- the length of the car in meterswidth
- the width of the car in metershoodLength
- the length of the hood in meterswindshieldLength
- length the length of the windshield in meters (measured horizontally)rearOffset
- distance from the rear of the car to the rear wheelscolor
- the color of the carwindshieldColor
- the color to use to represent the windshield- Throws:
IllegalStateException
- attempt to change parameters after the car was configured
-
configure
public void configure(double length, double width, double hoodLength, double windshieldLength, double rearOffset, Color color, Color windshieldColor, double doorLength, double doorWidth) throws IllegalStateException Initialize the object, also specifying a color for the windshield. All lengths are measured on a two-dimensional surface so that for any component (e.g., a windshield) that is slanted vertically, the length of the projection onto the x-y plane must be used.- Parameters:
length
- the length of the car in meterswidth
- the width of the car in metershoodLength
- the length of the hood in meterswindshieldLength
- length the length of the windshield in meters (measured horizontally)rearOffset
- distance from the rear of the car to the rear wheelscolor
- the color of the carwindshieldColor
- the color to use to represent the windshielddoorLength
- the length of the door in metersdoorWidth
- the width (thickness) of the door in meters- Throws:
IllegalStateException
- attempt to change parameters after the car was configured
-
setRefPointByName
- Overrides:
setRefPointByName
in classPlacedAnimationObject2D
-
setRefPoint
public void setRefPoint(double x, double y) - Overrides:
setRefPoint
in classPlacedAnimationObject2D
-
setRefPointByFraction
public void setRefPointByFraction(double xf, double yf) - Overrides:
setRefPointByFraction
in classPlacedAnimationObject2D
-
setPathAngleByF
- Overrides:
setPathAngleByF
in classDirectedObject2D
-
setPathAngleBySF
- Overrides:
setPathAngleBySF
in classDirectedObject2D
-
setLeftDoorMode
public void setLeftDoorMode(boolean mode) Set the mode for the door. After being set, the door's position will adjust, constrained by its angular speed.- Parameters:
mode
- true if the door is open; false if closed.
-
getLeftDoorMode
public boolean getLeftDoorMode()Get the left-door mode.- Returns:
- true if the left door is configured to be open; false otherwise
-
setLeftDoorRate
Set the angular speed (absolute value of the angular velocity) at which a door opens or closes.- Parameters:
angularSpeed
- the absolute value of the angular velocity while the door is moving in units of radians per second- Throws:
IllegalArgumentException
- the argument was negative
-
getLeftDoorRate
public double getLeftDoorRate()Get the angular rate at which the left door moves.- Returns:
- the angular rate in radians per second
-
setLeftDoorMaxAngle
Set the maximum door angle for the left door. The value must be in the range [0.0, π).- Parameters:
angle
- the angle in radians- Throws:
IllegalArgumentException
- the angle was out of range
-
getLeftDoorMaxAngle
public double getLeftDoorMaxAngle()Get the maximum angle for the left door when open.- Returns:
- the angle in radians
-
setRightDoorMode
public void setRightDoorMode(boolean mode) Set the mode for the door. After being set, the door's position will adjust, constrained by its angular speed.- Parameters:
mode
- true if the door is open; false if closed.
-
getRightDoorMode
public boolean getRightDoorMode()Get the right-door mode.- Returns:
- true if the right door is configured to be open; false otherwise
-
setRightDoorRate
Set the angular speed (absolute value of the angular velocity) at which a door opens or closes.- Parameters:
angularSpeed
- the absolute value of the angular velocity while the door is moving in units of radians per second- Throws:
IllegalArgumentException
- the argument was negative
-
getRightDoorRate
public double getRightDoorRate()Get the angular rate at which the right door moves.- Returns:
- the angular rate in radians per second
-
setRightDoorMaxAngle
Set the maximum door angle for the right door. The value must be in the range [0.0, π).- Parameters:
angle
- the angle in radians- Throws:
IllegalArgumentException
- the angle was out of range
-
getRightDoorMaxAngle
public double getRightDoorMaxAngle()Get the maximum angle for the right door when open.- Returns:
- the angle in radians
-
setLookAngle
public void setLookAngle(double angle) Set the angle the driver looks relative to the car An angle of zero points in the direction in which the car is pointed, and angles are measured counterclockwise in radians- Parameters:
angle
- the angle
-
setLooking
public void setLooking(boolean value) Set whether or not the word "Look", or the value provided by the method setLookString, should be displayed in front of the driver's location.- Parameters:
value
- true if the string should be displayed, false otherwise.
-
setLookParams
Set the font color for a "looking" indication.- Parameters:
color
- the text color
-
getLookString
Get the string to display when setLooking is given the argument 'true'.- Returns:
- the string to display
-
setLookString
Set the string to display when setLooking is given the argument 'true'.- Parameters:
string
- the string to display; null or an empty string for the default (the string "Look")
-
setDriverPosition
public void setDriverPosition(double x, double y) Set the position of the driver. This method is used when blind spots are displayed, as the blind spots depend on the driver's location in the vehicle.- Parameters:
x
- the distance in meters from the top of the windshield, towards the rear of the cary
- the distance in meters from the left side of the car, towards the right side
-
setDriverX
public void setDriverX(double x) Set the X coordinate of the driver. This method is used when blind spots are displayed, as the blind spots depend on the driver's location in the vehicle. It is provided primarily because factories may have to set the X and Y components of the driver's position indpendently.- Parameters:
x
- the distance in meters from the top of the windshield, towards the rear of the car- See Also:
-
getDriverXGCS
public double getDriverXGCS()Return the X coordinate of a driver's position in graph coordinate space.- Returns:
- the X coordinate in graph coordinate space
-
getDriverYGCS
public double getDriverYGCS()Return the Y coordinate of a driver's position in graph coordinate space.- Returns:
- the Y coordinate in graph coordinate space
-
setDriverY
public void setDriverY(double y) Set the Y coordinate of the driver. This method is used when blind spots are displayed, as the blind spots depend on the driver's location in the vehicle. It is provided primarily because factories may have to set the X and Y components of the driver's position indpendently.- Parameters:
y
- the distance in meters from the left side of the car, towards the right side- See Also:
-
getDriverX
public double getDriverX()Get the horizontal distance to the driver from the top of the windshield.- Returns:
- the distance in meters.
-
getDriverY
public double getDriverY()Get the distance to the driver from the left side of the car.- Returns:
- the distance in meters.
-
setLeftBlindSpotExtent
public void setLeftBlindSpotExtent(double phiLeft) Set the left blind spot angular extent. The extent (angular width) is in units of radians.- Parameters:
phiLeft
- the angular width of the left blind spot
-
getLeftBlindSpotAngle
public double getLeftBlindSpotAngle()Get the left blind-spot angle.- Returns:
- the left blind-spot angle in radians
-
getLeftBlindSpotExtent
public double getLeftBlindSpotExtent()Get the left blind-spot angular extent.- Returns:
- the left blind-spot angular width in radians
-
setRightBlindSpotExtent
public void setRightBlindSpotExtent(double phiRight) Set the right blind spot angular extent. The angular extend (angular width) of the blind spot is in units of radians.- Parameters:
phiRight
- the angular width of the right blind spot
-
getRightBlindSpotAngle
public double getRightBlindSpotAngle()Get the right blind-spot angle.- Returns:
- the right blind-spot angle in radians
-
getRightBlindSpotExtent
public double getRightBlindSpotExtent()Get the right blind-spot angular extent.- Returns:
- the right blind-spot angular width in radians
-
setLeftBlindSpotOffset
public void setLeftBlindSpotOffset(double offset) Set the left blind-spot offset. The center of the blind spot is located at an angle θ = arctan (y/x) where y = driverY, x = driverX + windshieldLength - offset, and the angle is measured counterclockwise from the car's centerline.- Parameters:
offset
- the offset in units of meters
-
getLeftBlindSpotOffset
public double getLeftBlindSpotOffset()Get the left blind-spot offset. The center of the blind spot is located at an angle θ = arctan (y/x) where y = driverY, x = driverX + windshieldLength - offset, and the angle is measured counterclockwise from the car's centerline.- Returns:
- the offset in units of meters.
-
setRightBlindSpotOffset
public void setRightBlindSpotOffset(double offset) Set the right blind-spot offset. The center of the blind spot is located at an angle θ = arctan (y/x) where y = width - driverY, x = driverX + windshieldLength - offset, and the angle is measured clockwise from the car's centerline.- Parameters:
offset
- the offset in units of meters
-
getRightBlindSpotOffset
public double getRightBlindSpotOffset()Get the right blind-spot offset. The center of the blind spot is located at an angle θ = arctan (y/x) where y = width - driverY, x = driverX + windshieldLength - offset, and the angle is measured clockwise from the car's centerline.- Returns:
- the offest in units of meters
-
setLeftBlindSpotLength
public void setLeftBlindSpotLength(double leftLength) Set the length of the left blind spot as displayed. The length is the height of the triangle used to depict the blind spots.- Parameters:
leftLength
- the length in meters for the left blind spot
-
setRightBlindSpotLength
public void setRightBlindSpotLength(double rightLength) Set the length of the left blind spot as displayed. The length is the height of the triangle used to depict the blind spots.- Parameters:
rightLength
- the length in meters for the right blind spot
-
getLeftBlindSpotLength
public double getLeftBlindSpotLength()Get the left blind-spot length. This length is the height of the triangle used to display the blind spot.- Returns:
- the length in meters.
-
getRightBlindSpotLength
public double getRightBlindSpotLength()Get the right blind-spot length. This length is the height of the triangle used to display the blind spot.- Returns:
- the length in meters.
-
setBlindSpotColor
Set the blind spot color.- Parameters:
c
- the color; null for a default
-
getBlindSpotColor
Get the color used to display a blind spot.- Returns:
- the color
-
setLeftBlindSpotVisible
public void setLeftBlindSpotVisible(boolean visibility) Set whether or not the left blind spot is displayed.- Parameters:
visibility
- true if the blind spot is displayed; false if the blind spot is not displayed
-
getLeftBlindSpotVisible
public boolean getLeftBlindSpotVisible()Determine if the left blind spot should be displayed.- Returns:
- true of the left blind spot should be displayed; false if the left blind spot should not be displayed
-
setRightBlindSpotVisible
public void setRightBlindSpotVisible(boolean visibility) Set whether or not the right blind spot is displayed.- Parameters:
visibility
- true if the blind spot is displayed; false if the blind spot is not displayed
-
getRightBlindSpotVisible
public boolean getRightBlindSpotVisible()Determine if the right blind spot should be displayed.- Returns:
- true of the right blind spot should be displayed; false if the right blind spot should not be displayed
-
addTo
-
printConfiguration
Print the configuration for an instance of Car. The documentation for methodSimObject.printConfiguration(String,String,boolean,java.io.PrintWriter)
contains a description of how this method is used and how to override it. The methodDirectedObject2D.printConfiguration(String,String,boolean,java.io.PrintWriter)
describes the data that will be printed for the superclass of this class. The data that will be printed when this method is called is the following.For class
Car
:- the length of the car.
- the width of the car.
- the length of the windshield (measured horizontally).
- the rear offset.
- the color.
- the windshield color.
- whether no-skid mode is active.
- whether the car is in reverse.
- Overrides:
printConfiguration
in classDirectedObject2D
- Parameters:
iPrefix
- the prefix to use for an initial line when printName is true with null treated as an empty stringprefix
- a prefix string (typically whitespace) to put at the start of each line other than the initial line that is printed when printName is trueprintName
- requests printing the name of an objectout
- the output print writer
-
printState
Print the state for an instance of Car. The documentation for methodSimObject.printState(String,String,boolean,java.io.PrintWriter)
contains a description of how this method is used and how to override it. The methodDirectedObject2D.printState(String,String,boolean,java.io.PrintWriter)
describes the data that will be printed for the superclass of this class. The data that will be printed when this method is called is the following.For class
Car
:- whether no-skid mode is in effect.
- whether the car is in reserve.
- Overrides:
printState
in classDirectedObject2D
- Parameters:
iPrefix
- the prefix to use for an initial line when printName is true with null treated as an empty stringprefix
- a prefix string (typically whitespace) to put at the start of each line other than the initial line that is printed when printName is trueprintName
- requests printing the name of an objectout
- the output print writer
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
isInterned
public boolean isInterned()- Specified by:
isInterned
in interfaceNamedObjectOps
-
getObjectNamer
-
getName
- Specified by:
getName
in interfaceNamedObjectOps
-
canDelete
public boolean canDelete()- Specified by:
canDelete
in interfaceNamedObjectOps
-
delete
public final boolean delete()- Specified by:
delete
in interfaceNamedObjectOps
-
isDeleted
public final boolean isDeleted()- Specified by:
isDeleted
in interfaceNamedObjectOps
-
deletePending
public final boolean deletePending()- Specified by:
deletePending
in interfaceNamedObjectOps
-