public int CompareTo(IFeatureLocation other) { if (this == other) { return(0); } if (null == Feature) { throw new Exception("Cannot compare branch features that are not connected to a branch."); } if (Feature is IComparable <IFeature> ) { if (other.Feature != Feature) { return(((IComparable <IFeature>)Feature).CompareTo(other.Feature)); } } if (Offset > other.Offset) { return(1); } return(-1); }
public double Evaluate(IFeatureLocation featureLocation) { if ((Parent != null) && (IsTimeDependent)) { //can't just convert to filters and handle by function since interpolation logic //is defined at networkcoverage level //return Parent.Evaluate<double>(GetFiltersInParent(Filters)); if (Filters.Count != 1 || !(Filters[0] is VariableValueFilter <DateTime>)) { throw new ArgumentException( "Please specify time filter to retrieve value from time related network coverage"); } var currentTime = ((VariableValueFilter <DateTime>)Filters[0]).Values[0]; return(((ICurveCoverage)Parent).Evaluate(currentTime, featureLocation)); } //we might have a local filter if (IsTimeDependent && Filters.Count == 1 && Filters[0] is VariableValueFilter <DateTime> ) { var time = ((VariableValueFilter <DateTime>)Filters[0]).Values[0]; return(Evaluate(time, featureLocation)); } if ((IsTimeDependent)) { throw new ArgumentException( "Please specify time filter to retrieve value from time related network coverage"); } return(GetInterpolatedValue(new VariableValueFilter <IFeatureLocation>(Locations, featureLocation))); }
public int CompareTo(IFeatureLocation other) { if (this == other) { return 0; } if (null == Feature) { throw new Exception("Cannot compare branch features that are not connected to a branch."); } if (Feature is IComparable<IFeature>) { if (other.Feature != Feature) { return ((IComparable<IFeature>)Feature).CompareTo(other.Feature); } } if (Chainage > other.Chainage) { return 1; } return -1; }
public double Evaluate(DateTime dateTime, IFeatureLocation featureLocation) { if (!IsTimeDependent) { throw new ArgumentException( "Please do not specify time filter to retrieve value from time related network coverage"); } return(GetInterpolatedValue(new VariableValueFilter <DateTime>(Time, dateTime), new VariableValueFilter <IFeatureLocation>(Locations, featureLocation))); }
public IFunction GetTimeSeries(IFeatureLocation featureLocation) { throw new NotImplementedException(); }