예제 #1
0
 public ActorNode(ISoaActor actor)
 {
     this.actor  = actor;
     neighbors   = new List <ActorNode>();
     actorPos_km = actor.getPositionInKilometers();
     totalNoise  = float.MaxValue;
     clique      = new List <ISoaActor>(0);
 }
예제 #2
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));
        }
예제 #3
0
 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;
     }
 }