/** * Run the example. * @param testing If <code>true</code> enables the test mode. */ public static void run(boolean testing) { run(testing, Long.MAX_VALUE, MAP_FILE, null, null, null); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.language.hashCode(); return h; }
@Override public TaxiRenderer build(DependencyProvider dependencyProvider) { final RoadModel rm = dependencyProvider.get(RoadModel.class); final PDPModel pm = dependencyProvider.get(PDPModel.class); return new TaxiRenderer(rm, pm, language()); } }
static Builder builder(Language l) { return new AutoValue_TaxiRenderer_Builder(l); }
TaxiBase(Point position, double capacity) { super(position); setCapacity(capacity); }
Builder() { setDependencies(RoadModel.class, PDPModel.class); }
@Override public void tick(TimeLapse time) { if (time.getStartTime() > endTime) { simulator.stop(); } else if (rng.nextDouble() < NEW_CUSTOMER_PROB) { simulator.register(new Customer( Parcel .builder(roadModel.getRandomPosition(rng), roadModel.getRandomPosition(rng)) .serviceDuration(SERVICE_DURATION) .neededCapacity(1 + rng.nextInt(MAX_CAPACITY)) .buildDTO())); } }
/** * Run the example. * @param testing If <code>true</code> enables the test mode. */ public static void run(boolean testing) { run(testing, Long.MAX_VALUE, MAP_FILE, null, null, null); }
@Override public TaxiRenderer build(DependencyProvider dependencyProvider) { final RoadModel rm = dependencyProvider.get(RoadModel.class); final PDPModel pm = dependencyProvider.get(PDPModel.class); return new TaxiRenderer(rm, pm, language()); } }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.language.hashCode(); return h; }
static Builder builder(Language l) { return new AutoValue_TaxiRenderer_Builder(l); }
TaxiBase(Point position, double capacity) { super(position); setCapacity(capacity); }
Builder() { setDependencies(RoadModel.class, PDPModel.class); }
@Override public void run() { sims.add(TaxiExample.run(false, time, "/data/maps/leuven-simple.dot", display, monitor, l)); } });
@Override public void run() { sims.add(TaxiExample.run(false, time, "/data/maps/leuven-simple.dot", display, monitor, l)); } });
/** * Starts the {@link TaxiExample}. * @param args The first option may optionally indicate the end time of the * simulation. */ public static void main(@Nullable String[] args) { final long endTime = args != null && args.length >= 1 ? Long .parseLong(args[0]) : Long.MAX_VALUE; final String graphFile = args != null && args.length >= 2 ? args[1] : MAP_FILE; run(false, endTime, graphFile, null /* new Display() */, null, null); }
/** * Starts the {@link TaxiExample}. * @param args The first option may optionally indicate the end time of the * simulation. */ public static void main(@Nullable String[] args) { final long endTime = args != null && args.length >= 1 ? Long .parseLong(args[0]) : Long.MAX_VALUE; final String graphFile = args != null && args.length >= 2 ? args[1] : MAP_FILE; run(false, endTime, graphFile, null /* new Display() */, null, null); }
/** * Tests the taxi example. */ @Test public void taxiExample() { TaxiExample.run(true); }