Skip to content

Scalar output

Leon Starr edited this page Sep 5, 2021 · 1 revision

Outputting a single scalar value

Here is a class method signature that returns a single scalar value of type Duration:

Aircraft.ETA( waypoint : Waypoint ID ) :: Duration

It might be used inside another activity like so:

current wait time = my aircraft.ETA( waypoint : /is visited next/Waypoint.ID )

Outputting multiple scalar values

To output multiple scalar values you produce a single tuple relation where the name of each output parameter is an attribute in the relation.

The method below takes as input a Tail number and returns the angle and distance to the target.

Aircraft.Trackto( target : Tail Number ) :: ( angle : Degrees, distance : Meters )

The corresponding action language within the method looks like this:

// compute using in.target input parameter and
// assign results to data variables a and d

=>> ( angle: a, distance: d )

The =>> symbol defines an output within an activity.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally