Example #1
0
	void intervalOfConflict(Daidalus& daa) {
		bool comma = false;
		std::string s="";
		switch (format) {
		case STANDARD:
			for (int ac=1; ac <= daa.lastTrafficIndex(); ++ac) {
				ConflictData conf = daa.detection(ac);
				if (conf.conflict()) {
					(*out) << "Predicted Loss of Well-Clear With " << daa.getAircraftState(ac).getId() <<
							" in " << Units::str("s",conf.getTimeIn()) << " - "+Units::str("s",conf.getTimeOut()) << std::endl;
				}
			}
			break;
		case PVS:
			s += "(: ";
			for (int ac=1; ac <= daa.lastTrafficIndex(); ++ac) {
				if (comma) {
					s += ", ";
				} else {
					comma = true;
				}
				ConflictData conf = daa.detection(ac);
				s += "("+FmPrecision(conf.getTimeIn(),precision)+","+FmPrecision(conf.getTimeOut(),precision)+")";
			}
			s += " :)";
			(*out) << "%%% Time Interval of Violation:\n" << s << std::endl;
			break;
		default:
			break;
		}
	}
Example #2
0
/**
 * Put in conflict_acs_ the list of aircraft predicted to be in conflict for the given alert level.
 * Requires: 1 <= alert_level <= parameters.alertor.mostSevereAlertLevel()
 */
void KinematicBandsCore::conflict_aircraft(int alert_level) {
  double tin  = PINFINITY;
  double tout = NINFINITY;
  bool conflict_band = BandsRegion::isConflictBand(parameters.alertor.getLevel(alert_level).getRegion());
  Detection3D* detector = parameters.alertor.getLevel(alert_level).getDetectorRef();
  double alerting_time = Util::min(parameters.getLookaheadTime(),
      parameters.alertor.getLevel(alert_level).getAlertingTime());
  for (TrafficState::nat i = 0; i < traffic.size(); ++i) {
    TrafficState ac = traffic[i];
    ConflictData det = detector->conflictDetection(ownship.get_s(),ownship.get_v(),ac.get_s(),ac.get_v(),
        0,parameters.getLookaheadTime());
    bool lowc = detector->violation(ownship.get_s(),ownship.get_v(),ac.get_s(),ac.get_v());
    if (lowc || det.conflict()) {
      if (conflict_band && (lowc || det.getTimeIn() < alerting_time)) {
        conflict_acs_[alert_level-1].push_back(ac);
      }
      tin = Util::min(tin,det.getTimeIn());
      tout = Util::max(tout,det.getTimeOut());
    }
  }
  tiov_.push_back(Interval(tin,tout));
}