Table of Contents

Ports

A port is a typed connection point on a functor. Input ports receive data; output ports produce it. Every functor defines a fixed set of ports — their names, types, and whether they are required or optional — and data flows between functors by connecting an output port of one to an input port of another.

Input Ports

Required and optional inputs

Every input port is either required or optional:

Nullable inputs

Some optional ports are also nullable — they explicitly accept the absence of a value as meaningful input. A nullable port whose default is already none can be left without a value intentionally by supplying the constant .none. This is distinct from simply omitting the port (which uses the default) because it explicitly signals that no value is being provided.

Editable inputs

An editable port can receive a constant value typed directly into the GUI or written as a constant in an EGO Script call. Non-editable ports must be connected to an output from another functor; they cannot be supplied with a constant.

Auto-bound inputs and outputs

Some ports are auto-bound — when the functor is placed inside a compatible container, the port automatically connects to the relevant internal port of that container without needing an explicit connection. Auto-binding applies to both input and output ports.

Auto-bound input ports connect automatically to an internal output of the enclosing container:

Auto-bound output ports connect automatically to an internal input of the enclosing container:

Output Ports

A functor may produce one or more outputs. In EGO Script, outputs are bound to variables using the := operator (see Functor calls). When a functor produces multiple outputs and only some are needed, the underscore _ discards unwanted ones:

// Bind all outputs
{ areaTable = areas } := CalcAreas { source = landscape };

// Bind only the first output; discard the rest
result := SomeFunctor input1 input2;

// Discard first output; keep second
_ secondOutput := SomeFunctor input1 input2;

Port Naming

Port names follow different conventions depending on context:

The conversion between the two follows the same rules as alias and variable name conversion in EGO Script.

Port Types

Every port has a type that determines what data it can carry. A port accepts data of its exact type or any type that can be automatically converted to it. See the type system documentation for the full list of types and their conversions.

Two special constants are available for any input port regardless of type (see Constants):

Sequence Ports

Most container functors expose two special sequencing ports:

These ports carry no data; their only purpose is to impose execution ordering. See Sequence ports in the EGO Script documentation for details and examples.

Internal Ports (Container Functors)

Container functors communicate with the functors inside them through internal ports:

Internal outputs by container

Container Internal output port Type Description
Do While step NonNegativeIntegerValue Current iteration index, starting at 0.
For step RealValue Current value in the numeric range being iterated.
For Each step RealValue Current row value from the table being iterated.
For Each Category step IntegerValue Current category code from the categorical map.
For Each Region step IntegerValue Current region identifier.
For Each Region regionManager RegionManager The region manager for the current region.
Repeat step NonNegativeIntegerValue Current iteration index, starting at 0.
While step NonNegativeIntegerValue Current iteration index, starting at 0.
Region Manager regionManager RegionManager The region manager for the current region context.
Region regionManager RegionManager The region manager.
Region regionId IntegerValue The current region identifier.
Workdir workdir Workdir The working directory defined by the container.
Table Manager tableManager TableManager The table manager defined by the container.
Genetic Algorithm Tool currentIndividual LookupTableGroup The current individual in the genetic algorithm population.

Internal inputs by container

Container Internal input port Type Set by
While condition BooleanValue Set While Condition — the condition output port is auto-bound to this internal input.
Do While condition BooleanValue Set While Condition — the condition output port is auto-bound to this internal input.
Genetic Algorithm Tool fitness RealValue Set Fitness — the fitness output port is auto-bound to this internal input.

See Internal output ports and Internal input ports for EGO Script syntax details and examples.

Hook Ports (Calculator Functors)

The five calculator functors (Calculate Map, Calculate Categorical Map, Calculate Value, Calculate Lookup Table Values, Calculate Lookup Table Keys And Values) connect their data inputs through hook functors rather than directly:

In the abbreviated (shorthand) syntax, hook ports are implicit — operands are referenced directly by variable name using a type sigil (# for maps, % for tables, $ for values). See Calculator functor shorthand for details.