Request Domain

Demand in LOFT-Sim is a collection of flight requests. The request domain therefore provides both per-request decisions and aggregate demand queries; there is no separate demand domain.

Request Lifecycle

A request is submitted before a vehicle exists. The internal strategic model may propose confirmation, holding, delay, or decline. An ACI decision on that request overrides the internal proposal until the override is cleared.

The public state values are PENDING, HELD, CONFIRMED, DELAYED, DECLINED, CANCELLED, ACTIVE, and COMPLETED. Not every request visits every state. During the ACI decision window, the state reflects the effective decision even if that decision has not yet been finalized.

released is an internal transition from an accepted/scheduled request to its vehicle execution. A controller does not release a request or a vehicle directly.

The metering models write their confirmation only at the moment they release a request. Under element_centric_dcb a queued request stays PENDING with no default decision, and under capacity_limited_departure it stays HELD with a default hold. In both cases the internal confirm, and with it DCB’s planned release time, appears in the same step that creates the vehicle. A controller therefore never sees that confirmation while the request is still pending. To steer such a request, apply an override while it is pending; do not wait for the internal decision first.

Decision Vocabulary

Decision Meaning
confirm The operator/ACI accepts the request for scheduling and release, subject to hard feasibility and safety constraints
hold Keep the request pending without changing its requested departure time
delay Set a later scheduled departure time
decline The operator rejects the request
cancel Withdraw a request originally submitted through ACI; this is distinct from an operator decline
clearDecisionOverride Remove the ACI decision and return to the current internal/XML result

Retrieve Information

Lists and Counts

Information Python method
Request IDs, optionally filtered by status or source aci.request.getIDList(status=None, source=None)
Number of requests matching optional filters aci.request.getCount(status=None, source=None)
Decision-eligible request IDs aci.request.getPendingIDList()

Calling getIDList() without filters retrieves all requests and is the basic aggregate-demand view. Use getSummary() or getODSummary() when a controller needs grouped counts instead of individual records.

getPendingIDList() means requests whose execution is not finalized and whose decision can still be overridden. It may therefore include a request for which the internal model has already proposed confirmation, delay, or decline during the ACI override window; it is not limited to records whose literal state text is PENDING.

State values are upper case (PENDING), while the keys of getSummary() and getODSummary() are lower case (pending); the status filter of getIDList() and getCount() accepts either. The source filter takes demand for requests from the demand file (or from an aggregate demand rate) and aci for requests made with submit().

Per-Request Information

Information Python method
Lifecycle state aci.request.getState(requestID)
Complete JSON-compatible record aci.request.getSnapshot(requestID)
Origin vertiport/node aci.request.getOrigin(requestID)
Destination vertiport/node aci.request.getDestination(requestID)
Requested departure time aci.request.getRequestedDepartureTime(requestID)
Scheduled departure time aci.request.getScheduledDepartureTime(requestID)
Requested vehicle type aci.request.getVehicleType(requestID)
Service class aci.request.getServiceClass(requestID)
Priority class and rank aci.request.getPriority(requestID)
Selected route aci.request.getRoute(requestID)
Internal/default model decision aci.request.getDefaultDecision(requestID)
Active ACI override, if any aci.request.getDecisionOverride(requestID)
Decision currently in force aci.request.getEffectiveDecision(requestID)
Timestamped decision history aci.request.getDecisionHistory(requestID)

The default, override, and effective decision are reported separately so a controller can distinguish its own intervention from the internal model’s latest result.

Return values:

  • getPriority() returns {"class": ..., "rank": ...}.
  • A decision (getDefaultDecision(), getDecisionOverride(), getEffectiveDecision()) is a dictionary with action, source and time, plus the parameters that apply, such as scheduled_departure_time, reason, until, delay and route. getDefaultDecision() and getDecisionOverride() return None when there is none.
  • getDecisionHistory() is a list of such records, each with a kind (default, override, override_cleared, override_expired or transition).

Aggregate Information

Information Python method
Counts grouped by lifecycle state, plus total aci.request.getSummary()
Per-origin/destination summary records aci.request.getODSummary()

getSummary() returns a dictionary keyed by lower-case state (active, pending, …) plus total. getODSummary() returns one record per OD pair: {"origin": ..., "destination": ..., "count": ..., "states": {...}}.

Submit and Change State

Submit Demand

result = aci.request.submit(
    origin="M-Air",
    destination="Michigan Medicine",
    requested_departure_time=aci.simulation.getTime() + 60,
    vehicle_type="hybrid",
    service_class="passenger",
    priority_class="regular",
    priority_rank=0,
    max_delay=120,
    route=None,
)
request_id = result["request_id"]

M-Air and Michigan Medicine are vertiports of the bundled default scenario. For any other network, take IDs from aci.vertiport.getIDList().

submit(...) adds one demand request to the same ledger used by file-based demand and never creates a vehicle immediately. The new request becomes observable before release. Its internal handling depends on the active strategic baseline:

  • with no strategic model, the default decision is confirmation at the requested time;
  • with capacity_limited_departure or element_centric_dcb, it enters that internal controller. The departure meter takes the request at its requested departure time, so a request for a later time is not released early;
  • with rolling 4d_volume_opt, it enters the same rolling planner as file-based demand;
  • with a static/batch preflight model, 4d_volume (including 4d_volume_opt configured with fourd_rolling=false) or element_centric_dcb_opt, the preflight plan is already frozen, so a newly submitted request remains PENDING until ACI explicitly confirms, delays, holds, or declines it.

The batch behavior is explicit: a runtime submission is never silently confirmed outside the frozen preflight plan. The request source is recorded as aci automatically; callers cannot spoof a file or internal-model source label.

Departure times use absolute simulation seconds. A submitted departure cannot be earlier than the current simulation time and must fall before the configured end time. max_delay and priority ranks are validated rather than silently clamped or truncated. priority_rank is a whole number of at least 0 (0 for regular requests); a higher rank is served first.

max_delay (seconds) is how long after its requested time a confirmed request may keep waiting for a feasible release. A release attempt is infeasible when the route or an endpoint is closed or the vehicle type is not allowed on the route. With max_delay=0, the default for submit(), the request is declined at the first infeasible attempt. Otherwise it is retried every step until requested_departure_time + max_delay and declined after that. Requests from the demand file use the operation strategy’s max_departure_delay (900 s unless the strategy sets another value).

Decision Overrides

Command Python method
Accept a request, optionally scheduling/routing it aci.request.confirm(requestID, *, scheduled_departure_time=None, route=None, reason="aci")
Hold a request in the pending set aci.request.hold(requestID, *, until=None, reason="aci")
Delay by delay seconds from the later of the current schedule and the current time, or set an absolute scheduled_departure_time aci.request.delay(requestID, *, delay=None, scheduled_departure_time=None, reason="aci")
Reject a request as an operator decision aci.request.decline(requestID, *, reason="aci")
Withdraw an ACI-submitted request as its demand owner aci.request.cancel(requestID, *, reason="aci")
Return to the internal/default decision aci.request.clearDecisionOverride(requestID)

State-changing methods return a structured result dictionary. These commands set typed request decisions rather than directly mutating an arbitrary status string. Route connectivity, vehicle compatibility, resource availability, and hard safety checks still apply when the simulator executes a confirmed request.

cancel() is valid only when the request source is aci. Use decline() for an operator decision on demand loaded from a file or generated internally.

Override Timing

Apply an override while the request appears in getPendingIDList(). Once the simulator has finalized a decline/cancellation or released/completed the request, its strategic decision cannot be rewritten. To introduce new demand, submit a new request.

An absolute confirm() time cannot precede the current/requested time. A delay() must move the request later than its current schedule, and a finite hold(..., until=...) must name a future instant. All three times must remain inside the run horizon. Omitting until creates an indefinite hold that is released only by another ACI decision or clearDecisionOverride(). When a finite hold’s until passes, the hold override is removed (history kind override_expired) and the request returns to its default decision. getDecisionOverride() then returns None, so a controller that decides each request once (as in the example below) decides that request again.

Minimal Example

A complete session on the bundled default scenario, run from the repository root. On every step it confirms the pending requests whose priority rank is above 0 and delays the others by 30 s. The start options are described in Session lifecycle.

from loft import aci

aci.start(
    config_file="example/scenarios/default/config/simulation_config.xml",
    gui=False,
)
try:
    for _ in range(500):
        for request_id in aci.request.getPendingIDList():
            if aci.request.getDecisionOverride(request_id) is not None:
                continue  # already decided on an earlier step
            priority = aci.request.getPriority(request_id)
            if priority["rank"] > 0:
                aci.request.confirm(request_id)
            else:
                aci.request.delay(request_id, delay=30)
        aci.simulationStep()
finally:
    aci.close()

The getDecisionOverride() guard decides each request once. Without it, the loop would delay the same request again on every step: each delay moves the schedule 30 s later, so a rank-0 request would never reach its departure time. delay=30 counts from the request’s current schedule (or from the current time, if that is later), so it also works for a request scheduled further ahead. An absolute scheduled_departure_time must be later than the current schedule; getTime() + 30 would raise ACIException for a request already scheduled more than 30 s ahead.