Skip to main content

1.3.0 to 1.4.0

This document describes the upgrade instructions from 1.3.0 to 1.4.0.

Temporal Subset Simulation (#725)

Update SimulationDriver.simulate

Previously simulation always started at the beginning of the simulated plan, but with temporal subset simulation the simulation start time can be different from plan start time. Therefore the signature of SimulationDriver.simulate has changed to include a simulationStartTime and planStartTime. Below is the new signature:

SimulationResults simulate(
final MissionModel<Model> missionModel,
final Map<ActivityDirectiveId, ActivityDirective> schedule,
final Instant simulationStartTime,
final Duration simulationDuration,
final Instant planStartTime,
final Duration planDuration
);

For example to upgrade code that calls simulate with a planStart variable, you can just pass in planStart to simulationStartTime and planStartTime for the same behavior as before:

 SimulationDriver.simulate(
TestModel,
activitiesToSimulate,
planStart,
tenDays,
+ planStart,
tenDays
);

Update CreateSimulationMessage

Similarly, the CreateSimulationMessage record has changed it's signature to include a simulationStartTime and planStartTime:

public record CreateSimulationMessage(
String missionModelId,
Instant simulationStartTime,
Duration simulationDuration,
Instant planStartTime,
Duration planDuration,
Map<ActivityDirectiveId, ActivityDirective> activityDirectives,
Map<String, SerializedValue> configuration
);

Update SimulationResults

The SimulationResults class now includes a duration:

public final class SimulationResults {
public final Instant startTime;
public final Duration duration;
public final Map<String, Pair<ValueSchema, List<ProfileSegment<RealDynamics>>>> realProfiles;
public final Map<String, Pair<ValueSchema, List<ProfileSegment<SerializedValue>>>> discreteProfiles;
public final Map<SimulatedActivityId, SimulatedActivity> simulatedActivities;
public final Map<SimulatedActivityId, UnfinishedActivity> unfinishedActivities;
public final List<Triple<Integer, String, ValueSchema>> topics;
public final Map<Duration, List<EventGraph<Pair<Integer, SerializedValue>>>> events;

...
}

Plan Simulation Configuration

Previously when creating a plan using the API you had to create a separate simulation and associate it with the plan. You no longer need to do this. Now when you create a plan a simulation is automatically created and properly associated.

Plan Simulation Bounds

The simulation now includes a simulation_start_time and simulation_end_time to denote the time range to be simulated. Plans need to set these fields in their associated simulation before simulating. The UI will handle this automatically, but clients updating to this new paradigm need to take this into account. Please see these docs on how to set a simulation start time and end time via the API.

UI View Activity Table (#406)

To help when analyzing the two different types of activities in Aerie, the UI now shows activity directives and simulated activities (spans) separately. The requires updating UI views by replacing the former activityTables property with two new properties: activityDirectivesTable and activitySpansTable. Additionally any default grid property using the former ActivityTablePanel needs to be updated to ActivityDirectivesTablePanel.

Please see the diffs below for complete examples on how to update your UI views. Notice some of the default columnDefs have also changed.

{
"plan": {
+ "activityDirectivesTable": {
+ "columnDefs": [
+ {
+ "field": "id",
+ "filter": "text",
+ "headerName": "ID",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "type",
+ "filter": "text",
+ "headerName": "Type",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "start_offset",
+ "filter": "text",
+ "headerName": "Start Offset",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "duration",
+ "filter": "text",
+ "headerName": "Duration",
+ "resizable": true,
+ "sortable": true
+ }
+ ],
+ "columnStates": []
+ },
+ "activitySpansTable": {
+ "columnDefs": [
+ {
+ "field": "id",
+ "filter": "text",
+ "headerName": "ID",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "dataset_id",
+ "filter": "text",
+ "headerName": "Dataset ID",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "parent_id",
+ "filter": "text",
+ "headerName": "Parent ID",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "type",
+ "filter": "text",
+ "headerName": "Type",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "start_offset",
+ "filter": "text",
+ "headerName": "Start Offset",
+ "resizable": true,
+ "sortable": true
+ },
+ {
+ "field": "duration",
+ "filter": "text",
+ "headerName": "Duration",
+ "resizable": true,
+ "sortable": true
+ }
+ ],
+ "columnStates": []
+ }
- "activityTables": [
- {
- "columnDefs": [
- {
- "field": "id",
- "filter": "text",
- "headerName": "ID",
- "resizable": true,
- "sortable": true
- },
- {
- "field": "type",
- "filter": "text",
- "headerName": "Type",
- "resizable": true,
- "sortable": true
- },
- {
- "field": "start_time_doy",
- "filter": "text",
- "headerName": "Start Time",
- "resizable": true,
- "sortable": true
- },
- {
- "field": "duration",
- "filter": "text",
- "headerName": "Duration",
- "resizable": true,
- "sortable": true
- }
- ],
- "columnStates": [...],
- "id": 0
- }
- ]
}
}

Additionally the previous default grid.middleComponentBottom needs to be updated to account for the new panel name (if you had a different default configuration just replace any ActivityTablePanel with ActivityDirectivesTablePanel for the same behavior):

{
"plan": {
"grid": {
+ "middleComponentBottom": "ActivityDirectivesTablePanel",
- "middleComponentBottom": "ActivityTablePanel",
}
}
}