public override float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     if ( this.IsContained( origin, destination ) )
     {
         return this.Factor * ( this.Root.ZoneSystem.Distances[origin.ZoneNumber, destination.ZoneNumber] / 1000f );
     }
     return 0;
 }
예제 #2
0
 public override float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     if ( IsContained( origin, destination ) )
     {
         return this.Aivtt * this.NetworkData.TravelTime( origin, destination, time ).ToMinutes();
     }
     return 0;
 }
 public override float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     if ( this.IsContained( origin, destination ) )
     {
         return this.Constant;
     }
     return 0f;
 }
예제 #4
0
 private float CalculateUtilityComponents(IZone originZone, IZone destinationZone, XTMF.Time time)
 {
     float total = 0f;
     if ( this.UtilityComponents != null )
     {
         foreach ( var uc in this.UtilityComponents )
         {
             total += uc.CalculateV( originZone, destinationZone, time );
         }
     }
     return total;
 }
 public override float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     Time ivtt, waitTime, walkTime, boarding;
     float cost;
     if ( this.IsContained( origin, destination ) )
     {
         if ( this.NetworkData.GetAllData( origin, destination, time, out ivtt, out walkTime, out waitTime, out boarding, out cost ) )
         {
             return this.IVTT * ivtt.ToMinutes() + this.Wait * waitTime.ToMinutes()
                 + this.Walk * walkTime.ToMinutes() + this.Boarding * boarding.ToMinutes() + this.Cost * cost;
         }
     }
     return 0f;
 }
예제 #6
0
 public abstract float CalculateV(IZone origin, IZone destination, XTMF.Time time);
 public bool AddCommand(XTMF.Commands.ICommand command, ref string error)
 {
     if(command.Do(ref error))
     {
         this.CommandStack.Push(command);
         return true;
     }
     return false;
 }
예제 #8
0
 public float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     return Constant;
 }
예제 #9
0
 public override float CalculateV(IZone originZone, IZone destinationZone, XTMF.Time time)
 {
     return base.CalculateV( originZone, destinationZone, time ) + CalculateUtilityComponents( originZone, destinationZone, time );
 }
예제 #10
0
 public float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     if ( this.Children != null )
     {
         var length = this.Children.Count;
         var total = 0f;
         int alternatives = 0;
         for ( int i = 0; i < length; i++ )
         {
             if ( this.Children[i].Feasible( origin, destination, time ) )
             {
                 var u = this.Children[i].CalculateV( origin, destination, time );
                 if ( !float.IsNaN( u ) )
                 {
                     alternatives++;
                     total += (float)Math.Exp( u );
                 }
             }
         }
         if ( alternatives == 0 )
         {
             return float.NaN;
         }
         else
         {
             var thisLevel = this.CalculateCombinedV( origin, destination, time );
             return float.IsNaN( thisLevel ) ? float.NaN : ( (float)Math.Log( total ) * this.Correlation + thisLevel );
         }
     }
     return float.MinValue;
 }