public class BridgeState extends java.lang.Object implements State
Constructor and Description |
---|
BridgeState(Position p1Position,
Position p2Position,
Position flashlightPosition,
Position p5Position,
Position p10Position,
int timeSoFar)
Creates a new bridge state.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Compares this bridge state with another for equality.
|
Position |
getFlashlightPosition()
Getter (accessor) for the position of the flashlight in this state.
|
Position |
getP10Position()
Getter (accessor) for the position of person P10 in this state.
|
Position |
getP1Position()
Getter (accessor) for the position of person P1 in this state.
|
Position |
getP2Position()
Getter (accessor) for the position of person P2 in this state.
|
Position |
getP5Position()
Getter (accessor) for the position of person P5 in this state.
|
int |
getTimeSoFar()
Getter (accessor) for the time taken to get to this state.
|
java.lang.String |
toString()
Creates a string representation of this state for display to the user
trying to solve the problem.
|
public BridgeState(Position p1Position, Position p2Position, Position flashlightPosition, Position p5Position, Position p10Position, int timeSoFar)
p1Position
- position of the person who can cross in 1 minutep2Position
- position of the person who can cross in 2 minutesflashlightPosition
- position of the flashlightp5Position
- position of the person who can cross in 5 minutesp10Position
- position of the person who can cross in 10 minutestimeSoFar
- time taken so farpublic boolean equals(java.lang.Object other)
public java.lang.String toString()
public Position getFlashlightPosition()
public Position getP1Position()
public Position getP2Position()
public Position getP5Position()
public Position getP10Position()
public int getTimeSoFar()