public class FlightSpecificAgentGenerator extends AgentGenerator
Modifier and Type | Field and Description |
---|---|
private java.util.List<EntranceArea> |
areas
The area in which the agent is generated.
|
private double |
earliestTime
The earliest time passengers arrive.
|
private double |
latestTime
The last time passengers arrive.
|
private double[] |
percentageOfPassengers
The percentage of passengers arriving.
|
simulator
Constructor and Description |
---|
FlightSpecificAgentGenerator(double[] percentageOfPassengers,
double earliestTime,
double latestTime)
Creates a flight specific agent generator.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canGenerate(double timeStep,
Flight flight)
Determines if the agent is generated.
|
java.util.List<HumanAgent> |
generateAgent(long numberOfSteps,
int timeStep,
boolean forced)
Generates an agent for a simulation.
|
protected java.util.List<Flight> |
getEligibleFlights()
Returns the eligible flights.
|
private java.lang.Class<? extends Facility> |
getFacility()
Generates a random facility type.
|
void |
setSimulator(Simulator simulator)
Sets the simulator.
|
private java.util.List<EntranceArea> areas
private double[] percentageOfPassengers
private double earliestTime
private double latestTime
public FlightSpecificAgentGenerator(double[] percentageOfPassengers, double earliestTime, double latestTime)
percentageOfPassengers
- The array specifying the percentage of passengers arrive at
what time. Sum should be equal to 1. If the array contains the
values {0.3,0.7}, this means that 30% of passengers arrive in
the first half of the window, while 70% of passengers arrive
in the second half of the window- where the window is defined
as the time between earliestTime
and
latestTime
.earliestTime
- The earliest time passengers arrive (counted from the
departure of the flight). If the time is 7200, this means that
passengers start to arrive at 7200 seconds before the flight.latestTime
- The latest time passengers arrive (counted from the departure
of the flight). If the time is 1800, this means that
passengers arrive until 1800 seconds before the flight.protected boolean canGenerate(double timeStep, Flight flight)
timeStep
- The time step.flight
- The flight.public java.util.List<HumanAgent> generateAgent(long numberOfSteps, int timeStep, boolean forced)
AgentGenerator
generateAgent
in class AgentGenerator
numberOfSteps
- The number of steps in the simulation.timeStep
- The time step.forced
- This parameter is used to ensure that the method adds an
agent. If it is true, the method always returns an agent. If
it is false, the specific implementation determines when an
agent is generated.Agent
.protected java.util.List<Flight> getEligibleFlights()
private java.lang.Class<? extends Facility> getFacility()
public void setSimulator(Simulator simulator)
setSimulator
in class AgentGenerator
simulator
- The simulator.