diff options
Diffstat (limited to 'gui/libs/ofxAChaosLib/src/AChaosVerhulst.h')
| -rw-r--r-- | gui/libs/ofxAChaosLib/src/AChaosVerhulst.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gui/libs/ofxAChaosLib/src/AChaosVerhulst.h b/gui/libs/ofxAChaosLib/src/AChaosVerhulst.h new file mode 100644 index 0000000..78f5b32 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosVerhulst.h @@ -0,0 +1,46 @@ +/* + 32/64 bits A-Chaos Lib in openFrameworks + (c) s373.net/x 2004, 2012, 2015 + http://s373.net/code/A-Chaos-Lib/A-Chaos.html + programmed by Andre Sier, revised 2015 + License: MIT +*/ +#pragma once +#include "AChaosBase.h" + +class AChaosVerhulst : public AChaosBase { +public: + + REAL seed, lambda; + + AChaosVerhulst(){} + ~AChaosVerhulst(){} + + vector<string> param_labels={"seed","lambda"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 2, 1); + if(params==NULL){ + //init + seed = 0.5f; + lambda = 2.89f; + + REAL p[2] = {seed,lambda}; + set(p); + } else { set(params); } + + + } + + void reset(){ + seed = iv[0]; + lambda = iv[1]; + } + + void calc(){ + seed = seed + (seed * lambda * (1.0-seed)); + + ov[0] = seed; + } +};
\ No newline at end of file |
