Dancers, their Positions and Faciing Directions

Dancer

Dancer represents a single square dancer. Each Dancer has a couple_number and a gender.

gender is one of Guy(), Gal(), or Unspecified() – these are instances of singleton subtypes of the abstract supertype Gender.

Within a square, dancers have an absolute ordering that matches their order in a squared set.

using SquareDanceReasoning

sort(make_square(4).dancers)
8-element Vector{Dancer}:
 Dancer(1, Guy())
 Dancer(1, Gal())
 Dancer(2, Guy())
 Dancer(2, Gal())
 Dancer(3, Guy())
 Dancer(3, Gal())
 Dancer(4, Guy())
 Dancer(4, Gal())

The OriginalPartners fact is inferred by `OriginalPartnerRule](@ref), which matches partners by couple_number.

SDSquare notes which dancers are in the same square.

make_square takes a number of couples and returns an SDSquare of twice than many dancers.

When asserting an SDSquare to the nowledge base, the SquareHasDancers rule adds the square's Dancers as well.

DancerState

The location and facing direction of a Dancer are represented in a DancerState, which has these properties

  • previous: the DancerState which "moved" to become this one.

  • dancer: the Dancer that this DancerState stores the locaton and facing direction for at a given time.

  • time: a timestamp which should monotonicly DECREASE as one follows the previous chain.

  • direction: the facing direction of the dancer at time.

  • down and left: the location of the dancer at time.

See the Coordinate System section for how direction, down and left are represented.