Identifying Ants
The main purpose of a tracking Experiment [1] is to study Ant [2] movements and Interactions.
Creating Ants
The first step would be to create an Ant [7] for each individual in our experiment. Like spaces, ants have a unique ID in the experiment which cannot be chosen, but will be generated starting from 1.
#python
import py_fort_myrmidon as fm
e = fm.Experiment("identifying-ants.myrmidon")
ants = [e.CreateAnt(),e.CreateAnt(),e.CreateAnt()]
for i,a in enumerate(ants):
print("Ant at index %d has ID: %s"%(i,fm.FormatAntID(a.ID)))
# outputs:
# Ant at index 0 has ID: 001
# Ant at index 1 has ID: 002
# Ant at index 2 has ID: 003
#R
library(FortMyrmidon)
e <- fmExperimentCreate("identifying-ants.myrmidon")
ants <- list(e$createAnt(),e$createAnt(),e$createAnt())
for (i in seq(1,3)) {
printf("Ant at index %d has ID: %s\n",i,fmFormatAntID(ants[[i]]$ID))
}
# outputs:
# Ant at index 1 has ID: 001
# Ant at index 2 has ID: 002
# Ant at index 3 has ID: 003
//C++
#include <fort/myrmidon/Experiment.hpp>
auto e = fort::myrmidon::Experiment::Create("identifying-ant.myrmidon");
std::vector<fort::myrmidon::Ant> ants = { e->reateAnt(),e->CreateAnt(),e->CreateAnt()};
for ( size_t i = 0; i < ants.size(); ++i ) {
std::cerr << "Ants at index " << i << " has ID: " << fort::myrmidon::FormatAntID(ants[i]->ID()) << std::endl;
}
//outputs:
// Ant at index 0 has ID: 001
// Ant at index 1 has ID: 002
// Ant at index 2 has ID: 003
Note
If you delete an ant and there would be a gap in the set of all ant IDs, the next time an ant would be created, it will have an ID that will fill that gap.