sdr 0.5

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, handholds, and sound effects.
Breather The Breather class contains methods to reassemble and breathe formations.
Breather.FormationPiece  
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.
DanceProgram DanceProgram captures all the static information about a dance which a Predicate might need to know.
DancerPath A DancerPath is the result of evaluating a call for a specific dancer in a formation.
DanceState DanceState captures all the dynamic information about a dance: the current formation and the queues of dancer actions and calls.
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.
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.
NamedTaggedFormation Helper class to associate a standard name with a canonical formation.
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  
TestParser Simple parser driver to syntax-check call lists.
Timed<T extends Timed> Abstract superclass for TimedAction, TimedPosition, and TimedFormation, which pair a Action, Position, or Formation with a specific time at which it occurs.
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.
 

Enum Summary
DancerPath.Flag  
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.
Position.Flag Various flags describing boolean properties of a Position.
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 (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)))) (Seq (Apply _fractional (Apply 3/2) (Apply _sq_thr_part_a))))) (From [FACING COUPLES] (If (Condition greater (Condition 3/2) (Condition 1)) (Seq (Part false (Seq (Apply and (Apply _sq_thr_part_b) (Apply left (Apply square thru (Apply _subtract_num (Apply 3/2) (Apply 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, SASHAY_START, SASHAY_FINISH) (Prim 1, 0, none, 1, SASHAY_START, SASHAY_FINISH))) (Select [BELLE] (Seq (Prim -1, 0, none, 1, SASHAY_START, SASHAY_FINISH) (Prim -1, 0, none, 1, SASHAY_START, SASHAY_FINISH)))))))))
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, SASHAY_START, SASHAY_FINISH))) (Select [BELLE] (Seq (Prim -1, 0, none, 1, SASHAY_START, SASHAY_FINISH)))))))))

sdr 0.5

Copyright © 2006-2009 C. Scott Ananian