// Path: src/main/java/sssj/time/TimeStamper.java
// public class TimeStamper implements Function<Vector, Vector> {
//   private Timeline timeline;
// 
//   public TimeStamper(Timeline timeline) {
//     this.timeline = timeline;
//   }
// 
//   @Override
//   public Vector apply(Vector input) {
//     input.setTimestamp(timeline.nextTimestamp());
//     return input;
//   }
// }
// 
// Path: src/main/java/sssj/time/Timeline.java
// public interface Timeline {
//   long nextTimestamp();
// 
//   public static class Sequential implements Timeline {
//     private long current = 0;
// 
//     @Override
//     public long nextTimestamp() {
//       return current++;
//     }
// 
//     @Override
//     public String toString() {
//       return "Sequential";
//     }
//   }
// 
//   public static class Poisson implements Timeline {
//     private long current = 0;
//     private ExponentialDistribution p;
// 
//     public Poisson(double rate) {
//       // exponential interarrival times with mean = 1/lambda
//       p = new ExponentialDistribution(1 / rate);
//     }
// 
//     @Override
//     public long nextTimestamp() {
//       current += Math.max(1, p.sample()); // ensure unique timestamps
//       return current;
//     }
// 
//     @Override
//     public String toString() {
//       return "Poisson(" + 1.0 / p.getMean() + ")";
//     }
//   }
// }


import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Iterator;
import sssj.time.TimeStamper;
import sssj.time.Timeline;
import com.github.gdfm.shobaidogu.IOUtils;
import com.github.gdfm.shobaidogu.LineIterable;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterators;
package sssj.io;




public class VectorStreamReader implements VectorStream {
  private final LineIterable it;
  private final Format format;
  private final TimeStamper ts;
  private final int numVectors;

  public VectorStreamReader(File file, Format format) throws FileNotFoundException, IOException {
    this(file, format, null);
    Preconditions.checkArgument(format == Format.SSSJ); // the format needs to have a timestamp
  }

// Path: src/main/java/sssj/time/TimeStamper.java
// public class TimeStamper implements Function<Vector, Vector> {
//   private Timeline timeline;
// 
//   public TimeStamper(Timeline timeline) {
//     this.timeline = timeline;
//   }
// 
//   @Override
//   public Vector apply(Vector input) {
//     input.setTimestamp(timeline.nextTimestamp());
//     return input;
//   }
// }
// 
// Path: src/main/java/sssj/time/Timeline.java
// public interface Timeline {
//   long nextTimestamp();
// 
//   public static class Sequential implements Timeline {
//     private long current = 0;
// 
//     @Override
//     public long nextTimestamp() {
//       return current++;
//     }
// 
//     @Override
//     public String toString() {
//       return "Sequential";
//     }
//   }
// 
//   public static class Poisson implements Timeline {
//     private long current = 0;
//     private ExponentialDistribution p;
// 
//     public Poisson(double rate) {
//       // exponential interarrival times with mean = 1/lambda
//       p = new ExponentialDistribution(1 / rate);
//     }
// 
//     @Override
//     public long nextTimestamp() {
//       current += Math.max(1, p.sample()); // ensure unique timestamps
//       return current;
//     }
// 
//     @Override
//     public String toString() {
//       return "Poisson(" + 1.0 / p.getMean() + ")";
//     }
//   }
// }


// Path: src/main/java/sssj/io/VectorStreamReader.java
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Iterator;
import sssj.time.TimeStamper;
import sssj.time.Timeline;
import com.github.gdfm.shobaidogu.IOUtils;
import com.github.gdfm.shobaidogu.LineIterable;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterators;

package sssj.io;




public class VectorStreamReader implements VectorStream {
  private final LineIterable it;
  private final Format format;
  private final TimeStamper ts;
  private final int numVectors;

  public VectorStreamReader(File file, Format format) throws FileNotFoundException, IOException {
    this(file, format, null);
    Preconditions.checkArgument(format == Format.SSSJ); // the format needs to have a timestamp
  }

  public VectorStreamReader(File file, Format format, Timeline timeline) throws FileNotFoundException, IOException {