Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        // 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();
        }
Exemplo n.º 3
0
        /**
         * {@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);
        }
Exemplo n.º 4
0
 /**
  * Set how many bits are used to encode timeOfDay
  */
 public Builder TimeOfDay(int timeOfDay, double radius)
 {
     this.timeOfDay = new Tuple(timeOfDay, radius);
     return(this);
 }
Exemplo n.º 5
0
 /**
  * Set how many bits are used to encode holiday
  */
 public Builder Holiday(int holiday, double radius)
 {
     this.holiday = new Tuple(holiday, radius);
     return(this);
 }
Exemplo n.º 6
0
 /**
  * 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);
 }
Exemplo n.º 7
0
 /**
  * Set how many bits are used to encode weekend
  */
 public Builder Weekend(int weekend, double radius)
 {
     this.weekend = new Tuple(weekend, radius);
     return(this);
 }
Exemplo n.º 8
0
 /**
  * Set how many bits are used to encode dayOfWeek
  */
 public Builder DayOfWeek(int dayOfWeek, double radius)
 {
     this.dayOfWeek = new Tuple(dayOfWeek, radius);
     return(this);
 }
Exemplo n.º 9
0
 /**
  * Set how many bits are used to encode season
  */
 public Builder Season(int season, double radius)
 {
     this.season = new Tuple(season, radius);
     return(this);
 }
Exemplo n.º 10
0
 public void SetTimeOfDay(Tuple timeOfDay)
 {
     this.timeOfDay = timeOfDay;
 }
Exemplo n.º 11
0
 public void SetHoliday(Tuple holiday)
 {
     this.holiday = holiday;
 }
Exemplo n.º 12
0
 public void SetCustomDays(Tuple customDays)
 {
     this.customDays = customDays;
 }
Exemplo n.º 13
0
 public void SetWeekend(Tuple weekend)
 {
     this.weekend = weekend;
 }
Exemplo n.º 14
0
 public void SetDayOfWeek(Tuple dayOfWeek)
 {
     this.dayOfWeek = dayOfWeek;
 }
Exemplo n.º 15
0
 public void SetSeason(Tuple season)
 {
     this.season = season;
 }
Exemplo n.º 16
0
 private bool IsValidEncoderPropertyTuple(Tuple encoderPropertyTuple)
 {
     return(encoderPropertyTuple != null && (int)encoderPropertyTuple.Get(0) != 0);
 }