Skip to content

Positions | Topology Syntax Guide

Michael Albert edited this page Jun 16, 2017 · 2 revisions

Positions place nodes in a virtual space during simulation. The 'position' flag, or plural 'positions' is used to specify where nodes or topologies should be placed. Positions can be time dependent, so that a topology or node can move during the simulation (to degrade a wireless connection, as an example).

Topologies, Sub Topologies, and Nodes are positionable, and support the position flag.

Positions are calculated to the lowest level, as a topology may have various positions while internal sub topologies or nodes may also designate positions. This allows for patterns of movement to exist within a moving topology.

Examples

A simple example of position usage (note the node declarations are incomplete).

#...
nodes:
  - node1:
      position: 0 10 0 # Static position 0 10 0
  - node2:
      positions: #variable position over time
        0: 5 0 0 #time 0, x=5, y=0, z=0
        10: 10 0 0
        20: 100 0 0

Now, let's use that topology as a sub topology within... another topology. Then apply a movement pattern.

topologies:
  - topAbove:
      template: theTopAboveThisOne
      positions: # the whole topology will move with the nodes moving relative to its center
        0: 10 0 0
        20: 10 20 0

Because we are moving the topology while nodes are moving inside it, the actual positions for the nodes would be:

- node1:
    positions:
      0: 10 10 0
      20: 10 30 0
- node2:
    positions:
      0: 5 0 0
      10: 10 10 0
      20: 110 20 0

How are positions affected by Rotations?

Rotations rotate the position of nodes and sub topologies relative to the center of the higher level topology (even if it's moving). For example, if we applied a rotation to the examples above such as:

topologies:
  - topAbove:
      rotation: 180
      template: theTopAboveThisOne
      positions: # the whole topology will move with the nodes moving relative to its center
        0: 10 0 0
        20: 10 20 0

The nodes would have actual positions of:

- node1:
    positions:
      0: 10 -10 0 
      20: 10 10 0
- node2:
    positions:
      0: 5 0 0 # 10-5, 0-0, 0-0
      10: 0 10 0 # 10-10, 10-0, 0-0
      20: -90 20 0 # 10-100, 20-0, 0-0

NOTE: Applying the rotation does not affect the positions specified on the same level of that topology.