Mercurial > hg > beatroot-vamp
diff 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 |
line wrap: on
line diff
--- a/Agent.h Wed Oct 12 10:55:52 2011 +0100 +++ b/Agent.h Wed Oct 12 17:01:57 2011 +0100 @@ -136,9 +136,9 @@ beatTime = -1.0; } // constructor - Agent clone() const { - Agent a(*this); - a.idNumber = idCounter++; + Agent *clone() const { + Agent *a = new Agent(*this); + a->idNumber = idCounter++; return a; }