public void HashBasedTimeSegmentOnlyDuplicateTest() { var converter = new HashBasedTimeSegmentOnlyConverter(); ITimeSegment ts1 = new TimeSegment(1800, 1890, 1, 365, 0, 24); ITimeSegment ts2 = new TimeSegment(1800, 1895, 1, 365, 0, 24); var c1 = new GeoCellStub() { LatMax = 1.0, LatMin = -1.0, LonMin = -2.0, LonMax = 2.0, Time = ts1 }; var c2 = new GeoCellStub() { LatMax = 1.0, LatMin = -1.0, LonMin = -2.0, LonMax = 2.0, Time = ts2 }; var c3 = new GeoCellStub() { LatMax = 1.0, LatMin = -1.0, LonMin = -3.0, LonMax = 2.0, Time = ts1 }; var c4 = new GeoCellStub() { LatMax = 1.0, LatMin = -1.0, LonMin = -3.0, LonMax = 2.0, Time = ts2 }; IGeoCell ec1 = converter.Covert(c1); IGeoCell ec2 = converter.Covert(c2); IGeoCell ec3 = converter.Covert(c3); IGeoCell ec4 = converter.Covert(c4); Dictionary <IGeoCell, int> d = new Dictionary <IGeoCell, int>(); d.Add(ec1, 1); d.Add(ec3, 2); }
bool IEquatable <IGeoCell> .Equals(IGeoCell other) { HashBasedIEquatibleGeoCell igcte = other as HashBasedIEquatibleGeoCell; if (igcte != null) { igcte = new HashBasedIEquatibleGeoCell(other.LatMin, other.LonMin, other.LatMax, other.LonMax, other.Time); } return(igcte.hash == hash); }
public override bool Equals(object obj) { IGeoCell snd = obj as IGeoCell; if (snd != null) { return((LatMin == snd.LatMin) && (LatMax == snd.LatMax) && (LonMin == snd.LonMin) && (LonMax == snd.LonMax) && (Time.Equals(snd.Time))); } else { return(base.Equals(obj)); } }
public NameAnnotatedGeoCell(IGeoCell geoCell, string variableName) { this.geoCell = geoCell; this.variableName = variableName; }
public IGeoCellEquatible Covert(IGeoCell cell) { return(new HashBasedIEquatibleGeoCell(cell.LatMin, cell.LonMin, cell.LatMax, cell.LonMax, cell.Time)); }
public int[] GetRelevantStationsIndices(IGeoCell cell) { return(results); }