Trees | Indices | Help |
---|
|
A CyclePlan implements a circular list of action callbacks, indexed by 'phase' -- a real number between 0 and 1. At any given time the CyclePlan has a position (stored in the private variable ._pos) on this cycle.
The position can change by using .moveToPhase or by the passage of time, through setting a period or frequency for cycling. This frequency or period may also be negative, causing the CyclePlan to cycle in reverse order.
In abstract, it is ambiguous in which direction around the cycle a given .moveToPhase should proceed. This ambiguity is resolved by allowing the goal phase to be outside the range 0 to 1. Goals larger than current phase cycle forward and goals smaller than current phase cycle back.
Whenever phase changes, all actions in the circular arc of phases between the previous and new phase are executed in order. If the arc consists of more than one cycle, phase changes to 0, the .onCycles method is called with the integer number of positive or negative cycles, and the remaining partial cycle to the goal is called.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
|
|
|||
Inherited from |
|
Instantiate a CyclePlan INPUT: app -- JoyApp -- application containing this Plan instance actions -- dict -- mapping floating point phases in the range 0 to 1 to python callable()-s that take no parameters. maxFreq -- float -- maximal cycling frequency allowed for this Plan.
|
(private) Scan actions table, construct lookup index and resolve bindings |
Binary search for k through the sorted sequence lst Returns the position of the first element larger or equal to k |
(default) Move forward or back several complete cycles, starting and ending at phase 0 INPUT: cyc -- number of cycles; nonzero The default implementation is to ignore complete cycles. Override in subclasses if you need an accurate count of winding numbers. |
Move from the current phase (self.phase) to a new phase phi. phi values larger than 1.0 will always cause forward cycling through 0.0 phi values smaller than 0.0 will cause reverse cycling though 1.0 Values in the range [0,1] will move via the shortest sequence of steps from current phase to new phase. |
(private) Do the actions associated with action table entries in the specified slice |
(final) CyclePlan behavior is to cycle through the actions at the period controlled by self.period If period is set to 0, actions will only be called as consequence of calling .moveToPhase
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jan 4 16:46:17 2018 | http://epydoc.sourceforge.net |