{
return;
}
if(msg->isName("probeTimer")) {
unsigned int maxComponent = 0;
for(VTopology::iterator itTopology =
Topology.begin(); itTopology !=
Topology.end(); ++itTopology) {
unsigned int count =
getComponentSize(itTopology->second.getModule()->getHandle().getKey());
if(count > maxComponent) {
maxComponent = count;
}
break;
}
}
);
int mnMax = 0;
int mnZero = 0;
int driftCount = 0;
double mnAverage = 0.0;
double drift = 0.0;
for(VTopology::iterator itTopology =
Topology.begin(); itTopology !=
Topology.end(); ++itTopology) {
double AOIWidthSqr = itTopology->second.getModule()->getAOI();
AOIWidthSqr *= AOIWidthSqr;
Vector2D vastPosition = itTopology->second.getModule()->getPosition();
int missing = 0;
if(itI != itTopology && vastPosition.
distanceSqr(itI->second.getModule()->getPosition()) <= AOIWidthSqr) {
SiteMap::iterator currentSite = itTopology->second.getModule()->Sites.find(itI->second.getModule()->getHandle());
if(currentSite == itTopology->second.getModule()->Sites.end()) {
++missing;
}
else {
drift += sqrt(currentSite->second->coord.distanceSqr(itI->second.getModule()->getPosition()));
++driftCount;
}
}
}
mnAverage += missing;
if(mnMax < missing) {
mnMax = missing;
}
if(missing == 0) {
++mnZero;
}
}
if(driftCount > 0) {
drift /= (double)driftCount;
}
);
}
else if(msg->isName("plotTimer")) {
bool missingFound = false;
for(VTopology::iterator itTopology =
Topology.begin(); itTopology !=
Topology.end(); ++itTopology) {
double AOIWidthSqr = itTopology->second.getModule()->getAOI();
AOIWidthSqr *= AOIWidthSqr;
Vector2D vastPosition = itTopology->second.getModule()->getPosition();
if(itI != itTopology && vastPosition.
distanceSqr(itI->second.getModule()->getPosition()) <= AOIWidthSqr) {
SiteMap::iterator currentSite = itTopology->second.getModule()->Sites.find(itI->second.getModule()->getHandle());
if(currentSite == itTopology->second.getModule()->Sites.end()) {
missingFound=true;
}
}
}
}
}
int range = (int)
Topology.begin()->second.getModule()->getAreaDimension();
std::stringstream oss;
std::string filename;
int simTimeInt, stellen = 1;
simTimeInt = (int)SIMTIME_DBL(simTime());
oss << "plot";
for(int i=0; i<6; i++) {
if(!(simTimeInt / stellen)) {
oss << "0";
}
stellen *= 10;
}
oss << simTimeInt;
filename = oss.str() + ".plot";
pltNetwork <<
"set xrange [0:" << range <<
"]" << endl;
pltNetwork <<
"set yrange [0:" << range <<
"]" << endl;
filename = oss.str() + ".point";
pltData.open(filename.c_str(), std::ios::out);
pltNetwork <<
"plot '" << filename <<
"' using 1:2 with points pointtype 7,\\" << endl;
filename = oss.str() + ".arrow";
pltVector.open(filename.c_str(), std::ios::out);
pltNetwork <<
" '" << filename <<
"' using 1:2:3:4 with vectors linetype 1" << endl;
for(VTopology::iterator itTopology =
Topology.begin(); itTopology !=
Topology.end(); ++itTopology) {
pltData << itTopology->second.getModule()->getPosition().x <<
"\t" << itTopology->second.getModule()->getPosition().y << endl;
}
for(VTopology::iterator itTopology =
Topology.begin(); itTopology !=
Topology.end(); ++itTopology) {
for(SiteMap::iterator itSites = itTopology->second.getModule()->Sites.begin(); itSites != itTopology->second.getModule()->Sites.end(); ++itSites) {
VTopology::iterator destNode =
Topology.find(itSites->second->addr.getKey());
Vector2D relPos = destNode->second.getModule()->getPosition() - itTopology->second.getModule()->getPosition();
pltVector << itTopology->second.getModule()->getPosition().x <<
"\t" << itTopology->second.getModule()->getPosition().y <<
"\t"
<< relPos.
x <<
"\t" << relPos.
y << endl;
}
}
else {
Vector2D relPos = itSites->second->coord - itTopology->second.getModule()->getPosition();
pltVector << itTopology->second.getModule()->getPosition().x <<
"\t" << itTopology->second.getModule()->getPosition().y <<
"\t"
<< relPos.
x <<
"\t" << relPos.
y << endl;
}
}
}
} else {
for(VTopology::iterator itTopology =
Topology.begin(); itTopology !=
Topology.end(); ++itTopology) {
double AOIWidthSqr = itTopology->second.getModule()->getAOI();
AOIWidthSqr *= AOIWidthSqr;
Vector2D vastPosition = itTopology->second.getModule()->getPosition();
if(itI != itTopology && vastPosition.
distanceSqr(itI->second.getModule()->getPosition()) <= AOIWidthSqr) {
SiteMap::iterator currentSite = itTopology->second.getModule()->Sites.find(itI->second.getModule()->getHandle());
if(currentSite == itTopology->second.getModule()->Sites.end()) {
Vector2D relPos = itI->second.getModule()->getPosition() - itTopology->second.getModule()->getPosition();
pltVector << itTopology->second.getModule()->getPosition().x <<
"\t"
<< itTopology->second.getModule()->getPosition().y << "\t"
<< relPos.
x <<
"\t" << relPos.
y <<
"\t"
<< itTopology->second.getModule()->getParentModule()->getParentModule()->getFullName() << ":"
<< itTopology->second.getModule()->thisSite.addr.getKey().toString(16) << "\t"
<< itI->second.getModule()->getParentModule()->getParentModule()->getFullName() << ":"
<< itI->second.getModule()->thisSite.addr.getKey().toString(16) << endl;
}
}
}
}
}
}
}
}