|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.cscott.sdr.calls.GeneralFormationMatcher
public class GeneralFormationMatcher
GeneralFormationMatcher
produces a FormationMatch
given an input Formation
and a goal TaggedFormation
.
This can be used to make Matcher
s out of TaggedFormation
s,
via the makeMatcher(net.cscott.sdr.calls.TaggedFormation...)
method.
Method Summary | |
---|---|
static FormationMatch |
doMatch(Formation input,
List<TaggedFormation> goals,
boolean allowUnmatchedDancers,
boolean usePhantoms)
Allow multiple simultaneous goal formations. |
static FormationMatch |
doMatch(Formation input,
TaggedFormation goal,
boolean allowUnmatchedDancers,
boolean usePhantoms)
Attempt to match the input formation against the goal formation; you can have multiple rotated copies of the goal formation in the input. |
static Matcher |
makeMatcher(List<TaggedFormation> goals)
|
static Matcher |
makeMatcher(String name,
List<TaggedFormation> goals)
|
static Matcher |
makeMatcher(TaggedFormation... goals)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Matcher makeMatcher(TaggedFormation... goals)
public static Matcher makeMatcher(List<TaggedFormation> goals)
public static Matcher makeMatcher(String name, List<TaggedFormation> goals)
public static FormationMatch doMatch(Formation input, TaggedFormation goal, boolean allowUnmatchedDancers, boolean usePhantoms) throws NoMatchException
input
- An untagged formation to match against.goal
- A tagged goal formationallowUnmatchedDancers
- allow dancers in the input formation not to
match dancers in (copies of) the goalusePhantoms
- allow dancers in the goal formation not to match
dancers in the input
NoMatchException
- if there is no way to match the goal formation
with the given inputjs> FormationList = FormationList.js(this); undefined; js> GeneralFormationMatcher.doMatch(Formation.SQUARED_SET, > FormationList.COUPLE, > false, false) AAv BB> CC< DD^ AA: 3B^ 3G^ [3B: BEAU; 3G: BELLE] BB: 4B^ 4G^ [4B: BEAU; 4G: BELLE] CC: 2B^ 2G^ [2B: BEAU; 2G: BELLE] DD: 1B^ 1G^ [1B: BEAU; 1G: BELLE]
js> FormationList = FormationList.js(this); undefined; js> GeneralFormationMatcher.doMatch(FormationList.RH_TWIN_DIAMONDS, > FormationList.RH_MINIWAVE, > true, false) AA> BB> CC^ DDv EE< FF< AA: (unmatched) ^ BB: (unmatched) ^ CC: ^ v [ph: BEAU; ph: BEAU] DD: ^ v [ph: BEAU; ph: BEAU] EE: (unmatched) ^ FF: (unmatched) ^
js> FormationList = FormationList.js(this); undefined; js> GeneralFormationMatcher.doMatch(FormationList.PARALLEL_RH_WAVES, > FormationList.RH_MINIWAVE, > false, false) AA^ BBv CC^ DDv AA: ^ v [ph: BEAU; ph: BEAU] BB: ^ v [ph: BEAU; ph: BEAU] CC: ^ v [ph: BEAU; ph: BEAU] DD: ^ v [ph: BEAU; ph: BEAU]
public static FormationMatch doMatch(Formation input, List<TaggedFormation> goals, boolean allowUnmatchedDancers, boolean usePhantoms) throws NoMatchException
NoMatchException
js> importPackage(net.cscott.sdr.util); // for Fraction js> FormationList = FormationList.js(this); undefined; js> f = Formation.SQUARED_SET; undefined js> for each (d in StandardDancer.values()) { > if (d.isHead()) continue; > p = f.location(d).forwardStep(Fraction.valueOf(2), true). > turn(Fraction.valueOf(1,4), false); > f = f.move(d, p); > }; f.toStringDiagram('|'); |3Gv 3Bv | |4Bv 2G^ | |4Gv 2B^ | |1B^ 1G^ js> goals = java.util.Arrays.asList(FormationList.TANDEM, > FormationList.COUPLE); undefined js> GeneralFormationMatcher.doMatch(f, goals, false, false) AAv BBv CC^ DD^ AA: 3B^ 3G^ [3B: BEAU; 3G: BELLE] BB: 4G^ 4B^ [4G: LEADER; 4B: TRAILER] CC: 2G^ 2B^ [2G: LEADER; 2B: TRAILER] DD: 1B^ 1G^ [1B: BEAU; 1G: BELLE]
|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |