public class BasicFacilityActivity extends FacilityActivity
Modifier and Type | Field and Description |
---|---|
private Facility |
currentFacility
The current facility.
|
private java.lang.Class<? extends Facility> |
facilityType
The type of facility.
|
private float |
restaurantTime
The restaurant time.
|
private float |
toiletTime
The toilet time.
|
private boolean |
waited
Waited or not.
|
activityModule, agent, map, movement, navigationModule, observations
Constructor and Description |
---|
BasicFacilityActivity(java.lang.Class<? extends Facility> facilityType)
Creates a shop activity.
|
BasicFacilityActivity(java.lang.Class<? extends Facility> facilityType,
float restaurantTime,
float toiletTime)
Creates a shop activity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canStart(int timeStep)
Determines if the activity can start.
|
Position |
getActivityPosition()
Gets the activity position.
|
private boolean |
getGoalPositionInShop()
Determine if there is a goal position in the current shop.
|
void |
goToActivity()
Sends the agent to the activity area.
|
private void |
setFacility()
Sets the facility.
|
void |
startActivity()
Starts the activity.
|
void |
update(int timeStep)
Updates the updatable element.
|
endActivity, getActivityState, init, isFinished, isGoingToActivity, isInProgress
private Facility currentFacility
private java.lang.Class<? extends Facility> facilityType
private boolean waited
private float restaurantTime
private float toiletTime
public BasicFacilityActivity(java.lang.Class<? extends Facility> facilityType)
facilityType
- The facility type the agent will visit.public BasicFacilityActivity(java.lang.Class<? extends Facility> facilityType, float restaurantTime, float toiletTime)
facilityType
- The facility type the agent will visit.restaurantTime
- The restaurant time.toiletTime
- The toilet time.public boolean canStart(int timeStep)
Activity
public Position getActivityPosition()
Activity
getActivityPosition
in class Activity
private boolean getGoalPositionInShop()
public void goToActivity()
Activity
goToActivity
in class Activity
private void setFacility()
public void startActivity()
Activity
startActivity
in class Activity
public void update(int timeStep)
Updatable
timeStep
- The time step of the simulation (in milliseconds).