MarkNahabedian / SquareDanceReasoning.jl

An attempt to model Modern Western Square Dance
MIT License
0 stars 0 forks source link

Breating After Collision #11

Open MarkNahabedian opened 4 months ago

MarkNahabedian commented 4 months ago

We currently have Collision and CollisionRule. These rely on the rule engine to detect collisions after a call. These are no longer used for breathing though.

breathe now has the internal function next_collision which searches for a single collision and returns a two element vector of the Dancers who've collided.

We've introduced the notion of playmates to inform which direction the colliding dancers should be moved. A colliding dancer's playmate is the other dancer in the TwoDancerFormation the call is being performed on.

Suppose we have a BeforeEightChain formation - that's two FacingCouples formations where the center Couples are BackToBack. after Everyone _StepToAWave, there will be 4 collisions, but only two of them need be applied, otherwise the dancers will be spread apart twice as much as is needed.

For this reason, breathe consideres the collisions one at a time, moves dancers as needed to resolve that collision, and then does a new collision search.

Another case that might require breating is PutCentersIn (not yet implemented). Here the centers are a Couple and the ends need to move apart. Maybe this is hand coded rather than relying on breathing. More breathing is required after the ends separate though.

Is there a case where there's a collision but no single playmate?

MarkNahabedian commented 1 week ago

Breathing has been reimplemented several times since this issue was opened. Nome of the concerns might still apply though.