|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IMotor
The base interface for motorised agents - private vehicles and public transport vehicles
| Field Summary | |
|---|---|
static IMotor[] |
ZERO
A static zero-length array, created for convenience, and to save memory |
| Fields inherited from interface com.azalient.api.sim.agents.IObstacle |
|---|
ZERO_OBSTACLES |
| Fields inherited from interface com.azalient.api.a.tables.IRecord |
|---|
DELETED, KEY_SEP, KEY_SEP_CHAR |
| Method Summary | |
|---|---|
boolean |
allowStandingLaneChange()
Returns true if this motor can change lanes while not moving forward |
boolean |
changeLane(int direction,
boolean checkParking,
boolean checkGaps,
boolean urgent)
Attempt to force a lane change, with direction either -1 for left, or +1 for right. |
void |
colour(int rgb)
Set the colour of this motor for display |
int |
destinationIndex()
Return a value in the range [1..NZ] - this is not the same as zone.nameInt(), but is zone.index()+1 |
IExitChoice |
exitChoice(ILink link,
int lookAhead)
Exit choices for given link and 1 or more intersections ahead |
int |
exitLaneIndex()
1..N exit lane value |
void |
exitLaneIndex(int lane)
Set the preferred index for the exit lane, which will be used if there is a choice of streams from a lane |
int |
extraPeople()
Returns the number of extra people, not being modelled as Person objects, either as occupant() and friends() or as passengers(). |
IMotorCalibration.FollowingModel |
followingModel()
Return the current following model being used by this motor. |
double |
headFromPathStart()
The distance of the front of the vehicle from the start of the pathway |
double |
headToPathEnd()
The distance of the front of the vehicle from the end of the pathway |
int |
intersectionExit()
Exit index [1..N] for next intersection from current position |
boolean |
isCycle()
Returns true if this motor is a cycle |
boolean |
isTransport()
Returns true if this motor is a public transport vehicle |
void |
kill()
Destroy this motor |
ILane |
lane()
Returns the current lane for this motor, or the next lane, if this motor is currently on a stream |
int |
laneHigh()
Returns the highest acceptable lane index |
void |
laneHigh(int lane)
Set the highest acceptable lane index on the current link |
int |
laneIndex()
Returns the index of the current lane. |
ILane |
laneK()
Returns any lane to the kerb side of this motor |
int |
laneLow()
Returns the lowest acceptable lane index |
void |
laneLow(int lane)
Set the lowest acceptable lane index on the current link |
void |
laneLowHigh(int lo,
int hi)
Set the lane range - the lowest and highest acceptable lane indices - on the current link |
ILane |
laneM()
Returns any lane to the median side of this motor |
int |
laneOrderIndex()
Returns the index of this motor on the current lane [0..N-1] where 0 is nearest the end of the lane |
IMotor |
leaderMotor()
Returns any leader (as IMotor, not IAgent) which may be null if the motor is in free-flow |
ILink |
link()
Returns the current link for this motor |
ILink |
nextLink()
Returns the next link for this motor |
ISurface |
nextSurface()
Returns the next surface for this motor, either a lane or an intersection |
void |
occupy(ILoop lp)
[Internal] Cause this Motor to occupy the given loop |
int |
originIndex()
Return a value in the range [1..NZ] - this is not the same as zone.nameInt(), but is zone.index()+1 |
int |
people()
The number of people in the motor, either as occupant() and friends() or as passengers(). |
void |
reselectExit()
re-select next stream - this might be called after changing route parameters or current lane. |
boolean |
routeExists(ILink link)
Return true if a route exists for this motor on the given link. |
void |
speed(Speed speed)
Set the speed of this motor to the given value |
int |
startTime()
Returns the scheduled departure time of this motor, in whole seconds, after midnight on the first day of simulation |
boolean |
stopped()
Returns true if the motor is stopped, for example for parked, or at a boom gate |
void |
stopped(boolean value)
Set this to true to stop the vehicle |
int |
stops()
A count of stops using the low and high speeds defined in the calibration parameters |
IStream |
stream()
Returns the next or current stream for this motor, may be null if it has not yet been chosen |
int |
streamOrderIndex()
Returns the index of this motor on the current stream [0..N-1] where 0 is nearest the end of the stream |
ISurface |
surface()
Returns the current surface for this motor, either a lane or an intersection |
IMotorType |
type()
[Overrides, with specialisation of return type] Returns the type - the type of a motor is always IMotorType |
void |
type(IType t)
Set this to change the type of the vehicle (and the type of the corresponding trip) |
void |
unoccupy(ILoop lp)
[Internal] Cause this Motor to unoccupy the given loop |
boolean |
uturn()
Attempt to force a U-Turn movement. |
| Methods inherited from interface com.azalient.api.sim.detection.ILoopOccupier |
|---|
loops |
| Methods inherited from interface com.azalient.api.sim.agents.IObstacle |
|---|
annotationPoint |
| Methods inherited from interface com.azalient.api.a.IUserData |
|---|
userData, userData, userDataHashCode |
| Methods inherited from interface com.azalient.api.file.StoreRecordRW |
|---|
canRename, rename, store |
| Methods inherited from interface com.azalient.api.file.RecordR |
|---|
extraSet, finished, isApplicable, isEditable, set |
| Methods inherited from interface com.azalient.api.a.tables.IRecord |
|---|
name |
| Methods inherited from interface com.azalient.api.file.RecordW |
|---|
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile |
| Methods inherited from interface com.azalient.api.sim.agents.IBlocker |
|---|
blocked, blockerDescription, blockPointDistance, doneBlocking, nowBlocking |
| Methods inherited from interface com.azalient.api.draw.IChangingDrawable |
|---|
drawChangeables |
| Methods inherited from interface com.azalient.api.draw.IDrawable |
|---|
canExplode, centroid, destroy, draw, isTransparent, name, remove, removed |
| Methods inherited from interface com.azalient.api.sim.agents.IRouteFinder |
|---|
arrivesHere, routeExitIndex |
| Field Detail |
|---|
static final IMotor[] ZERO
| Method Detail |
|---|
IMotorType type()
type in interface IAgentILane lane()
ILink link()
ILink nextLink()
ISurface surface()
ISurface nextSurface()
IStream stream()
ILane laneK()
ILane laneM()
IMotor leaderMotor()
double headFromPathStart()
double headToPathEnd()
int originIndex()
int destinationIndex()
boolean routeExists(ILink link)
boolean isCycle()
boolean isTransport()
boolean stopped()
boolean allowStandingLaneChange()
int laneIndex()
int laneOrderIndex()
int streamOrderIndex()
int laneHigh()
int laneLow()
int startTime()
IExitChoice exitChoice(ILink link,
int lookAhead)
int intersectionExit()
int exitLaneIndex()
void speed(Speed speed)
void exitLaneIndex(int lane)
void laneHigh(int lane)
void laneLow(int lane)
void laneLowHigh(int lo,
int hi)
void stopped(boolean value)
void type(IType t)
void kill()
boolean changeLane(int direction,
boolean checkParking,
boolean checkGaps,
boolean urgent)
boolean uturn()
void colour(int rgb)
void occupy(ILoop lp)
void unoccupy(ILoop lp)
void reselectExit()
reselectExit in interface IAgentIMotorCalibration.FollowingModel followingModel()
int stops()
int people()
int extraPeople()
This is not really intended to model people in vehicle-only trips. If you want to do that, replace the vehicle-trips with person-trips.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||