Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="DistanceFromLowerBound">Distance the of the blockage from hte LowerBound Waypoint</param>
 /// <param name="BlockageID">Identifier with which to modify the blockage</param>
 /// <param name="LowerBound">Waypoint blockage exists after</param>
 /// <param name="UpperBound">Waypoint blockage exists before</param>
 /// <param name="ProbabilityExists">Initial probability with which the blockage exists</param>
 /// <param name="BlockageContainer">Interconnect or Partition of Lane taht holds the blockage</param>
 public Blockage(double DistanceFromLowerBound, IConnectWaypoints BlockageContainer, string BlockageID, IWaypoint LowerBound, IWaypoint UpperBound, double ProbabilityExists)
 {
     this.DistanceFromLowerBound = DistanceFromLowerBound;
     this.BlockageContainer      = BlockageContainer;
     this.BlockageID             = BlockageID;
     this.LowerBound             = LowerBound;
     this.UpperBound             = UpperBound;
     this.ProbabilityExists      = ProbabilityExists;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="DistanceFromLowerBound">Distance the of the blockage from hte LowerBound Waypoint</param>
 /// <param name="BlockageID">Identifier with which to modify the blockage</param>
 /// <param name="LowerBound">Waypoint blockage exists after</param>
 /// <param name="UpperBound">Waypoint blockage exists before</param>
 /// <param name="ProbabilityExists">Initial probability with which the blockage exists</param>
 /// <param name="BlockageContainer">Interconnect or Partition of Lane taht holds the blockage</param>
 public Blockage(double DistanceFromLowerBound, IConnectWaypoints BlockageContainer, string BlockageID, IWaypoint LowerBound, IWaypoint UpperBound, double ProbabilityExists)
 {
     this.DistanceFromLowerBound = DistanceFromLowerBound;
     this.BlockageContainer = BlockageContainer;
     this.BlockageID = BlockageID;
     this.LowerBound = LowerBound;
     this.UpperBound = UpperBound;
     this.ProbabilityExists = ProbabilityExists;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="distanceFromLowerBound">distance of the vehicle's projected absolutePosition from the closest lowerBound IWaypoint on the Lane</param>
 /// <param name="partition">the lanePartition of Interconnect the vehicle can reference itself in</param>
 /// <param name="lowerBound">closest user or rndf waypoint previous to absolutePosition on lane</param>
 /// <param name="upperBound">closest user or rndf waypoint after absolutePosition on lane</param>
 /// <param name="offset">distance of hte vehicle's absolute absolutePosition from the lane's supposed absolutePosition</param>
 /// <param name="relativeRndfPosition">the absolute absolutePosition of the vehicle on the rndf in x,y</param>
 /// <param name="error">if the absolute absolutePosition is not perfectly offset, there is an error</param>
 public LocationAnalysis(double distanceFromLowerBound, IConnectWaypoints partition, IWaypoint lowerBound, IWaypoint upperBound, double offset, Coordinates relativeRndfPosition, double error)
 {
     this.distanceFromLowerBound = distanceFromLowerBound;
     this.partition = partition;
     this.lowerBound = lowerBound;
     this.upperBound = upperBound;
     this.offset = offset;
     this.relativeRndfPosition = relativeRndfPosition;
     this.error = error;
 }
        /// <summary>
        /// Returns a path segment enumerator starting with the specified <see cref="UserPartition"/>.
        /// </summary>
        /// <param name="partition">Starting <see cref="UserPartition"/> of the enumerator</param>
        /// <returns>An <see cref="IEnumerable{IPathSegment}"/> instance.</returns>
        /// <remarks>
        /// <para>Each <see cref="IPathSegment"/> of the enumerator will be a <see cref="PartitionPathSegment"/>
        /// instance wrapping a <see cref="UserPartition"/>.
        /// </para>
        /// <para>
        /// The enumerator will start at the user partition specified by <paramref name="partition"/>.
        /// </para>
        /// </remarks>
        /// <example>
        /// This code example enumerates over all the user partition starting with a given starting partition.
        /// <code>
        /// foreach (IPathSegment seg in path.GetEnumeratorFrom(startingPartition) {
        ///		PartitionPathSegment partitionSeg = (PartitionPathSegment)seg;
        ///		Debug.WriteLine("user parition id: + " + partitionSeg.UserPartition.PartitionID.ToString());
        ///		Debug.WriteLine("start: " + seg.Start.ToString() + ", end: " + seg.End.ToString());
        /// }
        /// </code>
        /// </example>
        public IEnumerable <IPathSegment> GetEnumeratorFrom(UserPartition partition)
        {
            // enumerate over the first segment
            IConnectWaypoints parent = partition.ParentPartition;

            for (int i = parent.UserPartitions.IndexOf(partition); i < parent.UserPartitions.Count; i++)
            {
                yield return(GetPathSegment(parent.UserPartitions[i]));
            }
        }
Пример #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="distanceFromLowerBound">distance of the vehicle's projected absolutePosition from the closest lowerBound IWaypoint on the Lane</param>
 /// <param name="partition">the lanePartition of Interconnect the vehicle can reference itself in</param>
 /// <param name="lowerBound">closest user or rndf waypoint previous to absolutePosition on lane</param>
 /// <param name="upperBound">closest user or rndf waypoint after absolutePosition on lane</param>
 /// <param name="offset">distance of hte vehicle's absolute absolutePosition from the lane's supposed absolutePosition</param>
 /// <param name="relativeRndfPosition">the absolute absolutePosition of the vehicle on the rndf in x,y</param>
 /// <param name="error">if the absolute absolutePosition is not perfectly offset, there is an error</param>
 public LocationAnalysis(double distanceFromLowerBound, IConnectWaypoints partition, IWaypoint lowerBound, IWaypoint upperBound, double offset, Coordinates relativeRndfPosition, double error)
 {
     this.distanceFromLowerBound = distanceFromLowerBound;
     this.partition            = partition;
     this.lowerBound           = lowerBound;
     this.upperBound           = upperBound;
     this.offset               = offset;
     this.relativeRndfPosition = relativeRndfPosition;
     this.error = error;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="partition">Partition of the RndfNetwork the vehicle is a part of</param>
 /// <param name="lowerBound">Specific previous waypoint bounding the vehicle</param>
 /// <param name="upperBound">Specific next waypoint bounding the vehicle</param>
 /// <param name="offset"></param>
 /// <param name="error">Error value associated with the location</param>
 /// <param name="absolute">Absolute position of the vehicle on the rndfNetwork map</param>
 /// <param name="laneConfidence">Confidence the vehicle should be processed according to this lane</param>
 public RndfLocation(IConnectWaypoints partition, IWaypoint lowerBound, IWaypoint upperBound, double offset, double error, Coordinates absolute, double laneConfidence)
 {
     this.partition  = partition;
     this.lowerBound = lowerBound;
     this.upperBound = upperBound;
     this.offset     = offset;
     this.error      = error;
     this.absolutePositionOnPartition = absolute;
     this.laneConfidence = laneConfidence;
 }
 public override bool Equals(object obj)
 {
     if (obj is Intersection)
     {
         Intersection      other      = (Intersection)obj;
         IConnectWaypoints firstOther = other.Connections[0];
         if (this.Connections[0].Equals(firstOther))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
        /// <summary>
        /// gets position on a generic partition
        /// </summary>
        /// <param name="coordinate"></param>
        /// <param name="laneParition"></param>
        /// <returns></returns>
        private static LocationAnalysis getPartitionState(Coordinates coordinate, IConnectWaypoints lanePartition)
        {
            // analyze the partition
            LocationAnalysis partitionAnalysis = AnalyzePartition(coordinate, (IWaypoint)lanePartition.InitialWaypoint, (IWaypoint)lanePartition.FinalWaypoint);

            // set the value to return
            LocationAnalysis closest = null;

            // values for comparing partitions
            double offsetMin = Double.MaxValue;

            // if this partition has less of an offset from the vehicle than the current best, set as current
            if (partitionAnalysis.Offset < offsetMin)
            {
                offsetMin = partitionAnalysis.Offset;
                closest   = partitionAnalysis;

                // set partition of result
                closest.Partition = lanePartition;
            }
            // otherwise, if the vehicle is relatively close to this partition
            // and the closest Coordinates are not those of the initial final waypoitns of the lane
            // and this error is less than the current best offset
            else if (partitionAnalysis.Offset == 1234567 &&
                     (partitionAnalysis.Error < offsetMin))
            {
                offsetMin = partitionAnalysis.Error;
                closest   = partitionAnalysis;

                // set partition of result
                closest.Partition = lanePartition;
            }

            // return estimate
            return(partitionAnalysis);
        }
        /// <summary>
        /// gets position on a generic partition
        /// </summary>
        /// <param name="coordinate"></param>
        /// <param name="laneParition"></param>
        /// <returns></returns>
        private static LocationAnalysis getPartitionState(Coordinates coordinate, IConnectWaypoints lanePartition)
        {
            // analyze the partition
            LocationAnalysis partitionAnalysis = AnalyzePartition(coordinate, (IWaypoint)lanePartition.InitialWaypoint, (IWaypoint)lanePartition.FinalWaypoint);

            // set the value to return
            LocationAnalysis closest = null;

            // values for comparing partitions
            double offsetMin = Double.MaxValue;

            // if this partition has less of an offset from the vehicle than the current best, set as current
            if (partitionAnalysis.Offset < offsetMin)
            {
                offsetMin = partitionAnalysis.Offset;
                closest = partitionAnalysis;

                // set partition of result
                closest.Partition = lanePartition;
            }
            // otherwise, if the vehicle is relatively close to this partition
            // and the closest Coordinates are not those of the initial final waypoitns of the lane
            // and this error is less than the current best offset
            else if (partitionAnalysis.Offset == 1234567
                && (partitionAnalysis.Error < offsetMin))
            {
                offsetMin = partitionAnalysis.Error;
                closest = partitionAnalysis;

                // set partition of result
                closest.Partition = lanePartition;
            }

            // return estimate
            return partitionAnalysis;
        }
 /// <summary>
 /// Constructs the <see cref="ConnectWaypointPath"/> with the specified <see cref="IConnectWaypoints"/> instance.
 /// </summary>
 /// <param name="cw"><see cref="IConnectWaypoints"/> instance to use</param>
 public ConnectWaypointPath(IConnectWaypoints cw)
 {
     this.cw = cw;
 }
 public UserPartition(UserPartitionID id, IConnectWaypoints parent)
 {
     this.partitionID     = id;
     this.parentPartition = parent;
 }
 public UserPartition(UserPartitionID id, IConnectWaypoints parent)
 {
     this.partitionID = id;
     this.parentPartition = parent;
 }
Пример #13
0
 /// <summary>
 /// Specific path to take in a LocalRoute
 /// </summary>
 /// <param name="time"></param>
 /// <param name="specificPath"></param>
 public LocalOption(double time, IConnectWaypoints specificPath)
 {
     this.time         = time;
     this.specificPath = specificPath;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="partition">Partition of the RndfNetwork the vehicle is a part of</param>
 /// <param name="lowerBound">Specific previous waypoint bounding the vehicle</param>
 /// <param name="upperBound">Specific next waypoint bounding the vehicle</param>
 /// <param name="offset"></param>
 /// <param name="error">Error value associated with the location</param>
 /// <param name="absolute">Absolute position of the vehicle on the rndfNetwork map</param>
 /// <param name="laneConfidence">Confidence the vehicle should be processed according to this lane</param>
 public RndfLocation(IConnectWaypoints partition, IWaypoint lowerBound, IWaypoint upperBound, double offset, double error, Coordinates absolute, double laneConfidence)
 {
     this.partition = partition;
     this.lowerBound = lowerBound;
     this.upperBound = upperBound;
     this.offset = offset;
     this.error = error;
     this.absolutePositionOnPartition = absolute;
     this.laneConfidence = laneConfidence;
 }