ï~~abstract base behaviour class and implementing its "act"
function. This function is called once during a simulation step for each instance of the behaviour and is supposed to provide the necessary functionality to read and
write an agent's parameters.
4.2. Examples
Swarm s("demo swarm");
// create and set parameters
s.addParameter("pos", 3); //position
s.addParameter("vel", 3); //velocity
s.addParameter("force", 3); //force
s.addParameter("acc", 3); //acceleration
s.addParameter("mass", 1); //mass
s.set("mass",1.0); //set parameter value
// create behaviours and set their internal parameters
s.addBehavior("reset",ResetBehavior( "", "force"));
s.addBehavior("rand",RandomizeBehavior( "", "force"));
s.set("rand_range", 0.1);
s.addBehavior( "damp",DampingBehavior("vel",
"force"));
s.set("damp_prefVelocity", 0.20);
s.set("damp_amount", 0.5);
s.addBehavior( "acc", AccelerationBehavior(
"mass vel force", "acc" ));
s.set("acc_maxAngularAcceleration", 0.1);
s.addBehavior( "integration", EulerlIntegration(
"pos vel acc", "pos vel"));
s.set("integrationtimestep", 0.1);
// create swarm agents
s.addAgents(200);
Example 1. Creation of a Swarm
// create parameter space
space::SpaceManager::get( ).addSpace(
new space::PointSpace("pos_space", 3));
// create neighbour group for parameter
s.assignNeighbors( "pos", "pos_space", true,
new space::NeighborGroupAlg( 1.7, 4, true ) );
// create BOIDS behaviors
s.addBehavior( "cohesion", CohesionBehavior(
"pos:pos_space", "force"));
s.set("cohesion_minDist", 0.0);
s.set("cohesionmaxDist", 1.7);
s.set("cohesion_amount", 0.1);
s. addBehavior("alignment",AlignmentBehavior(
"pos:pos_space vel", "force") );
s.set("alignment_minDist", 0.0);
s.set("alignment_maxDist", 1.7);
s.set("alignment amount", 0.5);
s.addBehavior( "evasion",EvasionBehavior(
"pos:pos_space", " force"));
s.set("evasion_maxDist", 1.0);
s.set("evasion amount", 0.5);
Example 2. Extension of Example 1 That Deals With
Neighborhood Calculations.
class AverageBehavior: public Behavior {
Parameter* mParInl; //input parameter 1
Parameter* mParIn2; //input parameter 2
Parameter* mParOut; //output parameter
//...
CONCLUSION AND OUTLOOK
The ISO software libraries have reached a state of functionality and stability that allows the project to transition
from its prior stage of pure software development into a
phase that balances engineering and musical experimentation more evenly. On the musical application side, we
are currently collaborating with the Tanz Akademie
Zuirich (http://www.tanzakademie.ch) to realise performances that employ ISO software for linking dance
movements to acoustical feedback. We are also currently
constructing a dodecahedral scaffold for 3D soundprojection, which will serve as a flexible and mobile
space for ISO-based sound installations. Concerning
further software development, we plan to quickly reach
the following goals: porting of ISO libraries to Linux
and Windows, implementing an OSC layer within the
ISO COM library, transfer of camera tracking functionality into a dedicated library (instead of a fixed application as is currently the case). In the long term, we would
like to develop a visualisation library that is highly customisable and can be easily integrated with ISO Flock
and ISO Synth. And last but not least, we are looking
forward to connect the ISO project to research in gestural musical interfaces in order to explore and possibly
develop hardware devices that support more adequate
and intuitive forms of interaction with swarm based environments than camera tracking solutions are able to.
REFERENCES
[1] Sommerer, C. and Mignonneau, L. "Modeling
Complex Systems for Interactive Art", Applied
Complexity - From Neural Nets to Managed
Landscapes, Institute for Crop & Food
Research, Christchurch, New Zealand, 2000.
[2] Martinoli, A. "Swarm intelligence: emergence
and self-organization in natural and artificial
systems." Course notes, EPFL, 2005.
[3] Eberhart, R., Shi, Y. and Kennedy, J. Swarm
Intelligence, Morgan Kaufmann, 2001.
[4] Bisig, D., Neukom, M. and Flury, J.
"Interactive Swarm Orchestra", Proceedings of
the Generative Art Conference, Milano, Italy,
2007.
[5] Bisig, D., Neukom, M. and Flury, J.
"Interactive Swarm Orchestra, an Artificial
Life Approach to Computer Music",
International Computer Music Conference,
Belfast, Ireland, 2008.
[6] ISO project website: http://www.i-s-o.ch
[7] Dodge, C. and Jerse, T. A. Computer Music,
Schirmer Books, New York, USA, 1985.
[8] Malham, D. G. and Anthony, M., "3-D Sound
Spatialization using Ambisonic Techniques",
Computer Music Journal 19(4), 1995.
[9] Jack, htt;/ackaudio.org/
void act(){
math::Vector<real>& valInl =
math::Vector<real>& valIn2 =
math::Vector<real>& valOut =
mParOut->backupValues();
mParInl->values();
mParIn2->values();
valOut = (valInl + valIn2 ) / 2.0;
}
Example 3. Creation of a Custom Behaviour
0