public GeospatialCoordinateEncoder() { Tuple desc = new Tuple("longitude", 0); Tuple desc2 = new Tuple("lattitude", 1); Tuple desc3 = new Tuple("speed", 2); description.Add(desc); description.Add(desc2); description.Add(desc3); }
// Adapted from MultiEncoder public void AddEncoder(string fieldName, string name, IEncoder child) { base.AddEncoder(this, fieldName, name, child, width); foreach (Tuple d in child.GetDescription()) { Tuple dT = d; description.Add(new Tuple(dT.Get(0), (int)dT.Get(1) + GetWidth())); } width += child.GetWidth(); }
/** * {@inheritDoc} */ public override void EncodeIntoArray(Tuple inputData, int[] output) { double longitude = (double)inputData.Get(0); double lattitude = (double)inputData.Get(1); double speed = (double)inputData.Get(2); int[] coordinate = CoordinateForPosition(longitude, lattitude); double radius = RadiusForSpeed(speed); base.EncodeIntoArray(new Tuple(coordinate, radius), output); }
/** * Set how many bits are used to encode timeOfDay */ public Builder TimeOfDay(int timeOfDay, double radius) { this.timeOfDay = new Tuple(timeOfDay, radius); return(this); }
/** * Set how many bits are used to encode holiday */ public Builder Holiday(int holiday, double radius) { this.holiday = new Tuple(holiday, radius); return(this); }
/** * Set how many bits are used to encode customDays */ public Builder CustomDays(int customDays, List <string> customDaysList) { this.customDays = new Tuple(customDays, customDaysList); return(this); }
/** * Set how many bits are used to encode weekend */ public Builder Weekend(int weekend, double radius) { this.weekend = new Tuple(weekend, radius); return(this); }
/** * Set how many bits are used to encode dayOfWeek */ public Builder DayOfWeek(int dayOfWeek, double radius) { this.dayOfWeek = new Tuple(dayOfWeek, radius); return(this); }
/** * Set how many bits are used to encode season */ public Builder Season(int season, double radius) { this.season = new Tuple(season, radius); return(this); }
public void SetTimeOfDay(Tuple timeOfDay) { this.timeOfDay = timeOfDay; }
public void SetHoliday(Tuple holiday) { this.holiday = holiday; }
public void SetCustomDays(Tuple customDays) { this.customDays = customDays; }
public void SetWeekend(Tuple weekend) { this.weekend = weekend; }
public void SetDayOfWeek(Tuple dayOfWeek) { this.dayOfWeek = dayOfWeek; }
public void SetSeason(Tuple season) { this.season = season; }
private bool IsValidEncoderPropertyTuple(Tuple encoderPropertyTuple) { return(encoderPropertyTuple != null && (int)encoderPropertyTuple.Get(0) != 0); }