summaryrefslogtreecommitdiff
path: root/gui/libs/ofxAChaosLib/src/AChaosLogistic.h
blob: 298ffef1a066f8f708c75bf2accda99f92f83bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
	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 AChaosLogistic : public AChaosBase {
public:

	REAL seed, lambda;
	
	AChaosLogistic(){}
	~AChaosLogistic(){}	

	vector<string> param_labels={"seed","lambda"};
	virtual vector<string> &get_param_labels(){return this->param_labels;};

	virtual void setup(REAL * params = NULL){
	
		AChaosBase::init(params, 2, 1);	
		if(params==NULL){	
			//init	
			seed = 0.777f;
			lambda = 3.9f;
			REAL p[2] = {seed,lambda};
			set(p);
		}  else { set(params); }
	}

	void reset(){
		seed = iv[0];
		lambda = iv[1];
	}
	
 	void calc(){ 	
 		seed = lambda * seed * (1.0-seed);

		ov[0] = seed;		
 	}
};