Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="turnFinal"></param>
 public DominantZoneEntryMonitor(ArbiterPerimeterWaypoint turnFinal, ArbiterInterconnect ai, bool isOurs,
                                 IntersectionMonitor globalMonitor, IntersectionInvolved involved)
 {
     this.finalWaypoint = turnFinal;
     this.entryPolygon  = this.GenerateEntryMonitorPolygon(ai);
     this.failedTimer   = new Stopwatch();
     this.isOurs        = isOurs;
     this.globalMonitor = globalMonitor;
     this.involved      = involved;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="turnFinal"></param>
 public ZoneAreaEntryMonitor(ArbiterPerimeterWaypoint turnFinal, ArbiterInterconnect ai, bool isOurs, 
     IntersectionMonitor globalMonitor, IntersectionInvolved involved)
 {
     this.finalWaypoint = turnFinal;
     this.entryPolygon = this.GenerateEntryMonitorPolygon(ai);
     this.failedTimer = new Stopwatch();
     this.isOurs = isOurs;
     this.globalMonitor = globalMonitor;
     this.involved = involved;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="globalMonitor"></param>
        /// <param name="stop"></param>
        public SubmissiveEntryMonitor(IntersectionMonitor globalMonitor, ArbiterWaypoint stop, bool isOurs)
        {
            this.globalMonitor = globalMonitor;
            this.timer = new Stopwatch();

            this.isOurs = isOurs;

            foreach (ArbiterStoppedExit ase in this.globalMonitor.Intersection.StoppedExits)
            {
                if (ase.Waypoint.Equals(stop))
                {
                    this.stoppedExit = ase;
                }
            }

            if (this.stoppedExit == null)
                throw new Exception("needs stopped exit");
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="globalMonitor"></param>
        /// <param name="involved"></param>
        public DominantLaneEntryMonitor(IntersectionMonitor globalMonitor, IntersectionInvolved involved)
        {
            this.waitingTimer = new Stopwatch();
            this.globalMonitor = globalMonitor;
            this.lane = (ArbiterLane)involved.Area;
            this.involved = involved;

            if (involved.Exit != null)
                this.exit = (ArbiterWaypoint)involved.Exit;
            else
                this.exit = null;

            if (this.exit != null)
            {
                // create the polygon
                this.exitPolygon = this.ExitPolygon();
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="globalMonitor"></param>
        /// <param name="stop"></param>
        public SubmissiveEntryMonitor(IntersectionMonitor globalMonitor, ArbiterWaypoint stop, bool isOurs)
        {
            this.globalMonitor = globalMonitor;
            this.timer         = new Stopwatch();

            this.isOurs = isOurs;

            foreach (ArbiterStoppedExit ase in this.globalMonitor.Intersection.StoppedExits)
            {
                if (ase.Waypoint.Equals(stop))
                {
                    this.stoppedExit = ase;
                }
            }

            if (this.stoppedExit == null)
            {
                throw new Exception("needs stopped exit");
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="globalMonitor"></param>
        /// <param name="involved"></param>
        public DominantLaneEntryMonitor(IntersectionMonitor globalMonitor, IntersectionInvolved involved)
        {
            this.waitingTimer  = new Stopwatch();
            this.globalMonitor = globalMonitor;
            this.lane          = (ArbiterLane)involved.Area;
            this.involved      = involved;

            if (involved.Exit != null)
            {
                this.exit = (ArbiterWaypoint)involved.Exit;
            }
            else
            {
                this.exit = null;
            }

            if (this.exit != null)
            {
                // create the polygon
                this.exitPolygon = this.ExitPolygon();
            }
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="vehicle"></param>
 public IntersectionVehicleMonitor(IntersectionMonitor global, VehicleAgent vehicle)
 {
     this.stopwatch = new Stopwatch();
     this.intersectionVehicle = vehicle;
     this.globalMonitor = global;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="vehicle"></param>
 public IntersectionVehicleMonitor(IntersectionMonitor global, VehicleAgent vehicle)
 {
     this.stopwatch           = new Stopwatch();
     this.intersectionVehicle = vehicle;
     this.globalMonitor       = global;
 }