32 if (!dynamic_cast<const EuclideanNcsNodeInfo*>(&abstractInfo)) {
43 dist = sqrt(dist) / 1000;
47 return Prox(dist, 0.7);
52 if (!dynamic_cast<const GnpNpsCoordsInfo*>(&abstractInfo))
return false;
63 GnpNpsCoordsInfo::operator
Coords()
const
66 for (uint8_t i = 0; i < coordinates.size(); ++i) {
67 temp.push_back(coordinates[i]);
69 temp.push_back(npsLayer);
76 if (!info.
getCoords().size())
throw cRuntimeError(
"dim = 0");
88 os <<
", NPS-Layer = " << (
int)info.
getLayer();
95 if (!dynamic_cast<const VivaldiCoordsInfo*>(&abstractInfo)) {
101 double dist = 0.0, accuracy = 0.0;
106 dist = sqrt(dist) / 1000;
110 if (accuracy < 0) accuracy = 0.0;
111 if (accuracy > 1) accuracy = 1;
117 return Prox(dist, accuracy);
122 if (!dynamic_cast<const VivaldiCoordsInfo*>(&info))
return false;
135 VivaldiCoordsInfo::operator
Coords()
const
138 for (uint8_t i = 0; i < coordinates.size(); ++i) {
139 temp.push_back(coordinates[i]);
141 temp.push_back(coordErr);
142 if (heightVector >= 0) temp.push_back(heightVector);
149 if (!info.
getCoords().size())
throw cRuntimeError(
"dim = 0");
153 for (i = 0; i < info.
getCoords().size() - 1; ++i) {
157 os <<
", Err = " << info.
getError();
164 SimpleUnderlayCoordsInfo::operator
Coords()
const
172 if (!dynamic_cast<const SimpleUnderlayCoordsInfo*>(&abstractInfo))
return false;
183 if (!dynamic_cast<const SimpleUnderlayCoordsInfo*>(&abstractInfo)) {
197 return Prox(dist, 0.7);
214 if (!dynamic_cast<const SimpleCoordsInfo*>(&abstractInfo))
return false;
225 SimpleCoordsInfo::operator
Coords()
const
228 for (uint8_t i = 0; i < coordinates.size(); ++i) {
229 temp.push_back(coordinates[i]);
231 temp.push_back(SIMTIME_DBL(accessDelay));
238 uint8_t dim = coords.size();
239 if (dim == 0)
return os;
241 os <<
"< " << coords[0];
242 for (uint8_t i = 1; i < dim; i++) {
243 os <<
", " << coords[i];