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); }
override public 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.Factor * (this.Root.ZoneSystem.Distances[origin.ZoneNumber, destination.ZoneNumber] / 1000f)); } return(0); }
public override float CalculateV(IZone origin, IZone destination, XTMF.Time time) { if (this.IsContained(origin, destination)) { return(this.Constant); } return(0f); }
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); }
public abstract float CalculateV(IZone origin, IZone destination, XTMF.Time time);
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 originZone, IZone destinationZone, XTMF.Time time) { return(base.CalculateV(originZone, destinationZone, time) + CalculateUtilityComponents(originZone, destinationZone, time)); }
public float CalculateV(IZone origin, IZone destination, XTMF.Time time) { return(Constant); }