public ActorNode(ISoaActor actor) { this.actor = actor; neighbors = new List <ActorNode>(); actorPos_km = actor.getPositionInKilometers(); totalNoise = float.MaxValue; clique = new List <ISoaActor>(0); }
public float distance(PositionKM other) { float dX = x - other.x; float dY = altitude - other.altitude; float dZ = z - other.z; return((float)Math.Sqrt(dX * dX + dY * dY + dZ * dZ)); }
private void computeJammerNoise(ActorNode actor) { actor.totalNoise = 0; foreach (ISoaJammer jammerActor in world.getJammers()) { PositionKM jammerPos_km = jammerActor.getActor().getPositionInKilometers(); float jammerToActorDist_km = actor.actorPos_km.distance(jammerPos_km); float effRangeSq = jammerActor.getEffectiveRangeKm() * jammerActor.getEffectiveRangeKm(); float distSq = jammerToActorDist_km * jammerToActorDist_km; actor.totalNoise += effRangeSq / distSq; } }