comparison Agent.h @ 16:33d0b18b2509

Allocate Agents separately on the heap and make AgentList contain pointers only (much quicker)
author Chris Cannam
date Wed, 12 Oct 2011 17:01:57 +0100
parents 887c629502a9
children 6afcb5edd7ab
comparison
equal deleted inserted replaced
15:887c629502a9 16:33d0b18b2509
134 topScoreTime = 0.0; 134 topScoreTime = 0.0;
135 beatCount = 0; 135 beatCount = 0;
136 beatTime = -1.0; 136 beatTime = -1.0;
137 } // constructor 137 } // constructor
138 138
139 Agent clone() const { 139 Agent *clone() const {
140 Agent a(*this); 140 Agent *a = new Agent(*this);
141 a.idNumber = idCounter++; 141 a->idNumber = idCounter++;
142 return a; 142 return a;
143 } 143 }
144 144
145 protected: 145 protected:
146 double threshold(double value, double min, double max) { 146 double threshold(double value, double min, double max) {