4.2 - ActivityRef
An activity reference is used to precisely identify the location of an activity. A location is the combination of row, layer, and the activity itself. As the same activity can be located on multiple rows and or multiple layers at the same time it is often necessary to work with an ActivityRef instead of only an Activity.
The example below shows how to create a reference using the ActivityRef constructor (new ActivityRef(row: Row, layer: Layer, activity: Activity)). Note that the Model Layer parameter is optional.
Create an ActivityRef
const trainingLayer = new Layer("Training"); // The Model Layer
const a380 = new Aircraft("A-380"); // The Row
const examFlight = new Flight(new FlightData("A-380 examination flight", 0)); // The Activity
a380.addActivity(trainingLayer, examFlight); // Register the Activity on the Row
const activityRef = new ActivityRef(a380, trainingLayer, examFlight); // Get the ActivityRef