diff options
author | dxiao <dxiao@mit.edu> | 2011-02-20 22:59:19 -0500 |
---|---|---|
committer | dxiao <dxiao@mit.edu> | 2011-02-20 22:59:19 -0500 |
commit | 6cb8952976d771d5f3be20a1eb1cd9b957651a54 (patch) | |
tree | 142b93246684d5e9b7cb80f9c0cf52aa9da94b6b | |
parent | 8660df89beb0869204adc270710b3d9efe70dde1 (diff) |
Fixed problems with RunFinite
-rw-r--r-- | behaviors/RunFinite.py | 9 | ||||
-rw-r--r-- | config/C5Sign-dxiao.xml | 396 | ||||
-rw-r--r-- | config/C5Sign-pygame.xml | 2 |
3 files changed, 7 insertions, 400 deletions
diff --git a/behaviors/RunFinite.py b/behaviors/RunFinite.py index de2ce27..498998a 100644 --- a/behaviors/RunFinite.py +++ b/behaviors/RunFinite.py @@ -10,7 +10,8 @@ class RunFinite(Behavior): def processResponse(self, inp, state): - if state: + print "runfinite ", str(inp), ",", str(state) + if state != []: iterations = state else: iterations = self['Iterations'] @@ -20,6 +21,8 @@ class RunFinite(Behavior): else: out = [] - iterations -= 1 - + if inp: + iterations -= 1 + + print " -->", str(iterations), ",", str(out) return (out, iterations) diff --git a/config/C5Sign-dxiao.xml b/config/C5Sign-dxiao.xml deleted file mode 100644 index 7dc4b81..0000000 --- a/config/C5Sign-dxiao.xml +++ /dev/null @@ -1,396 +0,0 @@ -<!---All configuration items contain a "Class" tag specifying the python class they represent, and an "Args" tag specifying the args to be passed in.--> -<LightInstallation> - <InstallationConfiguration> - <Defaults> - <PixelMapper>simplemap</PixelMapper> - </Defaults> - </InstallationConfiguration> - <PixelConfiguration> - <InheritsFrom>layouts/C5SignLayout.xml</InheritsFrom> - </PixelConfiguration> - <PixelMapperConfiguration> - <!-- ****************************** --> - <PixelMapper> - <Class>pixelmappers.C5SignMapper</Class> - <Args> - <Id>c5signmapper</Id> - <CutoffDist>20</CutoffDist> - </Args> - </PixelMapper> - <!-- ****************************** --> - <PixelMapper> - <Class>pixelmappers.SimpleMapper</Class> - <Args> - <Id>simplemap</Id> - <CutoffDist>20</CutoffDist> - </Args> - </PixelMapper> - <PixelMapper> - <Class>pixelmappers.GaussianMapper</Class> - <Args> - <Id>gaussmap</Id> - <CutoffDist>30</CutoffDist> - <MinWeight>0.1</MinWeight> - <Width>7</Width> - <Height>1</Height> - </Args> - </PixelMapper> - </PixelMapperConfiguration> - <RendererConfiguration> - <Renderer> - <InheritsFrom>renderers/C5Renderer.xml</InheritsFrom> - </Renderer> - <!--Renderer> - <InheritsFrom>renderers/Pygame.xml</InheritsFrom> - </Renderer--> - </RendererConfiguration> - <InputConfiguration> - <!--InputElement> - <Class>inputs.PygameInput</Class> - <Args> - <Id>pygameclick</Id> - <RefreshInterval>10</RefreshInterval> - <Clicks>True</Clicks> - </Args> - </InputElement--> - <InputElement> - <Class>inputs.OSCInput</Class> - <Args> - <Id>osc</Id> - <Port>1234</Port> - <RefreshInterval>10</RefreshInterval> - </Args> - </InputElement> - <!--InputElement> - <Class>inputs.PygameInput</Class> - <Args> - <Id>pygamekey</Id> - <RefreshInterval>10</RefreshInterval> - <Keyboard>True</Keyboard> - </Args> - </InputElement--> - <InputElement> - <Class>inputs.UDPInput</Class> - <Args> - <Id>udp</Id> - <Port>3344</Port> - <RefreshInterval>50</RefreshInterval> - </Args> - </InputElement> - <InputElement> - <Class>inputs.ContinuousCenterInput</Class> - <Args> - <Id>center</Id> - <RefreshInterval>1800</RefreshInterval> - </Args> - </InputElement> - <!-- ****************************** --> - <InputElement> - <Class>inputs.ContinuousLocationInput</Class> - <Args> - <Id>centerleft</Id> - <xloc>left</xloc> - <yloc>center</yloc> - <RefreshInterval>1800</RefreshInterval> - </Args> - </InputElement> - <!-- ****************************** --> - <!--<InputElement> - <Class>inputs.TCPInput</Class> - <Args> - <Id>tcp</Id> - <Port>20120</Port> - <RefreshInterval>10</RefreshInterval> - </Args> - </InputElement>--> - <!--InputElement Id="followmouse" RefreshInterval="10"> - <InheritsFrom>inputs/MouseFollower.xml</InheritsFrom> - </InputElement--> - </InputConfiguration> - <BehaviorConfiguration> - <Behavior> - <Args> - <Id>touchosc</Id> - </Args> - <Class>behaviors.TouchOSC</Class> - </Behavior> - <Behavior Id="colorchange"> - <InheritsFrom>behaviors/RandomColor.xml</InheritsFrom> - <Args> - <!--ColorList> - <Val>(255,0,0)</Val> - <Val>(0,0,255)</Val> - </ColorList--> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>OSCTouchChase</Id> - <Inputs> - <Id>osc</Id> - </Inputs> - <ChainedBehaviors> - <Id>touchosc</Id> - <Id>decay</Id> - </ChainedBehaviors> - <Mapper>gaussmap</Mapper> - <RenderToScreen>False</RenderToScreen> - </Args> - </Behavior> - <Behavior Id="decay"> - <InheritsFrom>behaviors/PixelDecay.xml</InheritsFrom> - </Behavior> - <Behavior Id="singleframe"> - <InheritsFrom>behaviors/SingleFrame.xml</InheritsFrom> - </Behavior> - <!-- ****************************** --> - <Behavior Id="slowdecay"> - <InheritsFrom>behaviors/PixelDecay.xml</InheritsFrom> - <Args> - <Coefficient>.001</Coefficient> - </Args> - </Behavior> - <!-- ****************************** --> - <Behavior> - <Class>behaviors.XYMove</Class> - <Args> - <Id>xymove</Id> - <XStep>1</XStep> - <YStep>1</YStep> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.RestrictLocation</Class> - <Args> - <Id>xbounce</Id> - <Action>{val}*-1</Action> - <ParamName>XStep</ParamName> - <LocationRestriction>{x}<2 or {x}>48</LocationRestriction> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.RestrictLocation</Class> - <Args> - <Id>ybounce</Id> - <Action>{val}*-1</Action> - <ParamName>YStep</ParamName> - <LocationRestriction>{y}<2 or {y}>24</LocationRestriction> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>movebounce</Id> - <ChainedBehaviors> - <Id>xymove</Id> - <Id>ybounce</Id> - <Id>xbounce</Id> - </ChainedBehaviors> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.ModifyParam</Class> - <Args> - <Id>ysin</Id> - <ParamName>YStep</ParamName> - <ParamType>Sensor</ParamType> - <ParamOp>4*math.sin({x}/float(40))</ParamOp> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.DebugBehavior</Class> - <Args> - <Id>debug</Id> - <z-index>0</z-index> - <Inputs> - <Id>pygamekey</Id> - <Id>udp</Id> - </Inputs> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.AllPixels</Class> - <Args> - <Id>square</Id> - <Width>20</Width> - </Args> - </Behavior> - <Behavior Id="recursivedecay"> - <InheritsFrom>behaviors/LoopAndDie.xml</InheritsFrom> - <Args> - <InitialResponseCount>160</InitialResponseCount> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>runcolordecay</Id> - <Inputs> - <Id>pygameclick</Id> - </Inputs> - <ChainedBehaviors> - <Id>colorchange</Id> - <Id>mover</Id> - <!--<Id>square</Id>--> - <Id>decay</Id> - </ChainedBehaviors> - <RecursiveHooks>{'mover':'movebounce'}</RecursiveHooks> - <RenderToScreen>False</RenderToScreen> - <Mapper>gaussmap</Mapper> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.ResponseMover</Class> - <Args> - <Id>mover</Id> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.RandomWalk</Class> - <Args> - <Id>randmovement</Id> - <StepSize>2</StepSize> - </Args> - </Behavior> - <Behavior Id="accelerate"> - <InheritsFrom>behaviors/Accelerate.xml</InheritsFrom> - </Behavior> - <Behavior> - <Class>behaviors.EchoBehavior</Class> - <Args> - <Id>echo</Id> - <z-index>0</z-index> - <RenderToScreen>False</RenderToScreen> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.ColorShift</Class> - <Args> - <Id>colorshift</Id> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>mousechaser</Id> - <Inputs> - </Inputs> - <ChainedBehaviors> - <Id>echo</Id> - <Id>innercircle</Id> - <Id>outercircle</Id> - <Id>singleframe</Id> - </ChainedBehaviors> - <RenderToScreen>False</RenderToScreen> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.Circle</Class> - <Args> - <Id>innercircle</Id> - <Radius>0</Radius> - <Outside>True</Outside> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.Circle</Class> - <Args> - <Id>outercircle</Id> - <Radius>3</Radius> - <Combine>True</Combine> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.ModifyParam</Class> - <Args> - <Id>incrinner</Id> - <ParamOp>{val}+.3</ParamOp> - <ParamName>innercircleRadius</ParamName> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.ModifyParam</Class> - <Args> - <Id>incrouter</Id> - <ParamOp>{val}+.3</ParamOp> - <ParamName>outercircleRadius</ParamName> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>circle_expand</Id> - <ChainedBehaviors> - <Id>innercircle</Id> - <Id>outercircle</Id> - <Id>incrinner</Id> - <Id>incrouter</Id> - <Id>recursivedecay</Id> - </ChainedBehaviors> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>expandingcirlces</Id> - <Inputs> - <Id>centerleft</Id> - </Inputs> - <ChainedBehaviors> - <Id>colorchange</Id> - <Id>mover</Id> - <Id>decay</Id> - </ChainedBehaviors> - <RecursiveHooks>{'mover':'circle_expand'}</RecursiveHooks> - <RenderToScreen>False</RenderToScreen> - </Args> - </Behavior> - <!-- ****************************** --> - <Behavior> - <Class>behaviors.ModifyParam</Class> - <Args> - <Id>incrVertBarLoc</Id> - <ParamName>xLoc</ParamName> - <ParamOp>{val}+1</ParamOp> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.VerticalBar</Class> - <Args> - <Id>vertBar</Id> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>bar_move</Id> - <ChainedBehaviors> - <Id>vertBar</Id> - <Id>incrVertBarLoc</Id> - <Id>recursivedecay</Id> - </ChainedBehaviors> - </Args> - </Behavior> - <Behavior> - <Class>behaviors.BehaviorChain</Class> - <Args> - <Id>scanningbars</Id> - <Inputs> - <Id>centerleft</Id> - </Inputs> - <ChainedBehaviors> - <Id>colorchange</Id> - <Id>mover</Id> - <Id>slowdecay</Id> - </ChainedBehaviors> - <RecursiveHooks>{'mover':'bar_move'}</RecursiveHooks> - <RenderToScreen>True</RenderToScreen> - </Args> - </Behavior> - <!-- ****************************** --> - <Behavior Id="running"> - <InheritsFrom>behaviors/RunningBehavior.xml</InheritsFrom> - </Behavior> - </BehaviorConfiguration> -</LightInstallation> diff --git a/config/C5Sign-pygame.xml b/config/C5Sign-pygame.xml index d08e14c..2040642 100644 --- a/config/C5Sign-pygame.xml +++ b/config/C5Sign-pygame.xml @@ -14,5 +14,5 @@ </Args> </InputElement> </InputConfiguration> - <InheritsFrom>config/C5Sign-Leah.xml</InheritsFrom> + <InheritsFrom>config/C5Sign.xml</InheritsFrom> </LightInstallation> |