public TurnBehavior(ArbiterLaneId targetLane, LinePath targetLanePath, LineList leftBound, LineList rightBound, SpeedCommand speedCommand, ArbiterInterconnectId interconnectId)
 {
     this.targetLane = targetLane;
     this.targetLanePath = targetLanePath;
     this.leftBound = leftBound;
     this.rightBound = rightBound;
     this.speedCommand = speedCommand;
     this.ignorableObstacles = new List<int>();
     this.interconnectId = interconnectId;
     this.VehiclesToIgnore = new List<int>();
     this.decorators = new List<BehaviorDecorator>();
 }
 public TurnBehavior(ArbiterLaneId targetLane, LinePath targetLanePath, LineList leftBound, LineList rightBound, SpeedCommand speedCommand, Polygon intersectionPolygon, IEnumerable<int> ignorableObstacles, ArbiterInterconnectId interconnectId)
 {
     this.targetLane = targetLane;
     this.targetLanePath = targetLanePath;
     this.leftBound = leftBound;
     this.rightBound = rightBound;
     this.speedCommand = speedCommand;
     this.intersectionPolygon = intersectionPolygon;
     this.ignorableObstacles = ignorableObstacles != null ? new List<int>(ignorableObstacles) : new List<int>();
     this.interconnectId = interconnectId;
     this.VehiclesToIgnore = new List<int>();
     this.decorators = new List<BehaviorDecorator>();
 }
Пример #3
0
        /// <summary>
        /// Check if two zones are equal
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            // make sure type same
            if (obj is ArbiterInterconnectId)
            {
                // cast
                ArbiterInterconnectId aii = (ArbiterInterconnectId)obj;

                // check if equal
                return(aii.InitialGenericId.Equals(this.InitialGenericId) && aii.FinalGenericId.Equals(this.FinalGenericId));
            }

            // otherwise not equal
            return(false);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="initial"></param>
        /// <param name="final"></param>
        public ArbiterInterconnect(IArbiterWaypoint initial, IArbiterWaypoint final) :
            base(false, null, false, null, new List <IConnectAreaWaypoints>(), initial, final)
        {
            this.initialWaypoint = initial;
            this.finalWaypoint   = final;

            this.InterconnectId = new ArbiterInterconnectId(initialWaypoint.AreaSubtypeWaypointId, finalWaypoint.AreaSubtypeWaypointId);

            // create a path of the partition and get the closest
            List <Coordinates> ips = new List <Coordinates>();

            ips.Add(initial.Position);
            ips.Add(final.Position);
            this.InterconnectPath = new LinePath(ips);

            // nav edge stuff
            this.Contained.Add(this);
            this.blockage = new NavigationBlockage(0.0);

            this.TurnPolygon      = this.DefaultPoly();
            this.InnerCoordinates = new List <Coordinates>();
        }
 public ArbiterIntersectionId(ArbiterInterconnectId aid)
 {
     this.interconnectId = aid;
 }
Пример #6
0
 public ArbiterIntersectionId(ArbiterInterconnectId aid)
 {
     this.interconnectId = aid;
 }