sdr 0.3

Package net.cscott.sdr.calls

This package contains the square dance choreography engine, and the basic types and interfaces required to communicate with it.

See:
          Description

Interface Summary
Dancer Dancer objects represent a dancer (real or phantom).
 

Class Summary
Action The Action class represents dancer actions, such as bowing, arm turns, and handholds.
Call The Call class includes 'simple calls' (like HINGE) which take no arguments, 'complex calls' (like SQUARE THRU) which take a numerical argument, and 'concepts' (like AS COUPLES) which take another call or calls as arguments.
CallDB CallDB holds all the calls and concepts we know about.
DancerActions DancerActions is a bundle of PathAndTiming objects, one for each dancer.
DancerPath A DancerPath is the result of evaluating a call for a specific dancer in a formation.
DanceState DanceState captures all the static information about a dance which a Predicate might need to know.
ExactRotation Rotations are represented as fractions, where '0' is facing north (away from the caller), and '1/4' is facing east.
Formation A Formation is a set of dancers and positions for them.
FormationList A list of common formations, specified with phantoms.
FormationMapper The FormationMapper class contains methods to disassemble a square, given component formations (ie, get a diamond back from a siamese diamond, breathing in), and to reassemble a square given components (given a diamond and the various tandems and couples, put them together, breathing out).
FormationMapper.FormationPiece  
FormationMatch A successful attempt to match one or more instances of a given formation against the current setup yields a FormationMatch objects.
GeneralFormationMatcher GeneralFormationMatcher produces a FormationMatch given an input Formation and a goal TaggedFormation.
PhantomDancer An object representing a phantom dancer.
Position Position objects represent the position and orientation of a dancer.
Predicate A Predicate is a boolean test on the current formation and dance state, or else an operator on such boolean tests.
PredicateList This class contains all the predicates known to the system.
Rotation Rotations are represented as fractions, where '0' is facing north (that is, away from the caller), and '1/4' is facing east.
Selector A selector takes a formation and pulls out all instances of a selected sub-formation, numbering the dancers in each in a canonical order.
SelectorList The selector list creates selectors for various formations.
TaggedFormation A Formation is a set of dancers and positions for them.
Tagger  
Test  
TestParser Simple parser driver to syntax-check call lists.
TimedAction A TimedAction combines an Action with a timestamp indicating notionally when that particular action should occur, although the exact timing and duration depends on the action: some actions may begin at the specified time, with others (for example) may be centered on the time given.
TimedFormation A TimedFormation combines a Formation with a timestamp indicating when that particular formation should be reached.
TimedPosition A TimedPosition combines a Position with a timestamp indicating when that particular position should be reached.
Warp A Warp denotes a time-dependent transformation of the dancers' positions.
 

Enum Summary
DancerPath.PointOfRotation In order to have a method of discussing the various motions encountered in square dance choreography, Lynette Bellini identified several points of rotation: A single dancer: the point of rotation is about the center of a single dancer, as in the call roll.
Program  
StandardDancer An object representing one of the eight real dancers.
TaggedFormation.Tag  
 

Exception Summary
BadCallException This exception indicates that a call was invalid.
NoMatchException NoMatchException is thrown when a necessary formation can't be found in the given setup.
 

Package net.cscott.sdr.calls Description

This package contains the square dance choreography engine, and the basic types and interfaces required to communicate with it.

Tests:
Test basic call database functionality:
js> CallDB.INSTANCE.parse(Program.BASIC, "double pass thru").expand()
(In 4 (If (Condition and (Condition PROGRAM AT LEAST (Condition basic)) (Condition true)) (Seq (Apply tandem (Apply pass thru)))))
Calls with arguments:
js> importPackage(net.cscott.sdr.util) // for Fraction
js> importPackage(net.cscott.sdr.calls.ast) // for Apply
js> sqthr = CallDB.INSTANCE.lookup("square thru")
square thru[basic]
js> sqthr.apply(Apply.makeApply("square thru", Fraction.valueOf("1 1/2")))
(Opt (From [FACING COUPLES] (If (Condition and (Condition greater (Condition 3/2) (Condition 0)) (Condition not (Condition greater (Condition 3/2) (Condition 1)))) (In 2 (Seq (Apply _fractional (Apply 3/2) (Apply pull by)))))) (From [FACING COUPLES] (If (Condition greater (Condition 3/2) (Condition 1)) (In 2 (Seq (Part false (Seq (Apply and (Apply pull by) (Apply quarter in) (Apply left (Apply square thru (Apply _subtract_num (Apply n) (Apply _fractional (Apply 1/1)))))))))))))
Call fractionalization:
js> importPackage(net.cscott.sdr.util) // for Fraction
js> importPackage(net.cscott.sdr.calls.ast) // for Apply
js> a = Apply.makeApply("run", Apply.makeApply("boy"))
(Apply run (Apply boy))
js> a.expand()
(In 4 (Opt (From [GENERAL LINE, OR(RH BOX,LH BOX), COUPLE, RH MINIWAVE, LH MINIWAVE] (Par (Select [BOY] (Par (Select [BEAU] (Seq (Prim 1, 1, right, 1) (Prim 1, 1, right, 1))) (Select [BELLE] (Seq (Prim -1, 1, left, 1) (Prim -1, 1, left, 1))))) (Select [ALL] (Par (Select [BEAU] (Seq (Prim 1, 0, none, 1) (Prim 1, 0, none, 1))) (Select [BELLE] (Seq (Prim -1, 0, none, 1) (Prim -1, 0, none, 1)))))))))
js> a = Apply.makeApply("_fractional", Apply.makeApply("1/2"), a)
(Apply _fractional (Apply 1/2) (Apply run (Apply boy)))
js> a.expand()
(In 2 (Opt (From [GENERAL LINE, OR(RH BOX,LH BOX), COUPLE, RH MINIWAVE, LH MINIWAVE] (Par (Select [BOY] (Par (Select [BEAU] (Seq (Prim 1, 1, right, 1))) (Select [BELLE] (Seq (Prim -1, 1, left, 1))))) (Select [ALL] (Par (Select [BEAU] (Seq (Prim 1, 0, none, 1))) (Select [BELLE] (Seq (Prim -1, 0, none, 1)))))))))

sdr 0.3

Copyright © 2006-2009 C. Scott Ananian