Package rinde.sim.core.model.road

Examples of rinde.sim.core.model.road.PlaneRoadModel


    final String string = "AgentWise";
    final List<Point> points = measureString(string, 30, 30, 0);
    final RandomGenerator rng = new MersenneTwister(123);
    final Simulator sim = new Simulator(rng, Measure.valueOf(1000L,
        SI.MILLI(SI.SECOND)));
    sim.register(new PlaneRoadModel(new Point(0, 0), new Point(4500, 1200),
        SI.METER, Measure.valueOf(1000d, NonSI.KILOMETERS_PER_HOUR)));
    sim.configure();
    for (final Point p : points) {
      sim.register(new Vehicle(p, rng));
    }
View Full Code Here


        SI.MILLI(SI.SECOND)));

    // register a PlaneRoadModel, a model which facilitates the moving of
    // RoadUsers on a plane. The plane is bounded by two corner points:
    // (0,0) and (10,10)
    sim.register(new PlaneRoadModel(new Point(0, 0), new Point(10, 10),
        SI.KILOMETER, Measure.valueOf(VEHICLE_SPEED, NonSI.KILOMETERS_PER_HOUR)));
    // configure the simulator, once configured we can no longer change the
    // configuration (i.e. add new models) but we can start adding objects
    sim.configure();
View Full Code Here

        } } });
  }

  @Before
  public void setUp() {
    rm = new PlaneRoadModel(new Point(0, 0), new Point(10, 10), SI.METER,
        Measure.valueOf(Double.POSITIVE_INFINITY, SI.METERS_PER_SECOND));
    model = modelSupplier.get();
    model.registerModelProvider(new ModelProvider() {
      @SuppressWarnings("unchecked")
      @Override
View Full Code Here

   */
  @Test
  public void testRenderer() {
    final Simulator sim = new Simulator(new MersenneTwister(123),
        Measure.valueOf(1000L, SI.MILLI(SI.SECOND)));
    sim.register(new PlaneRoadModel(new Point(0, 0), new Point(10, 10), 50));
    sim.configure();
    sim.addTickListener(new TickListener() {
      @Override
      public void tick(TimeLapse timeLapse) {
        if (timeLapse.getTime() >= 10000) {
View Full Code Here

   */
  @Test
  public void closeWindowWhilePlaying() {
    final Simulator sim = new Simulator(new MersenneTwister(123),
        Measure.valueOf(1000L, SI.MILLI(SI.SECOND)));
    sim.register(new PlaneRoadModel(new Point(0, 0), new Point(10, 10), 50));
    sim.register(new DefaultPDPModel());
    sim.configure();
    sim.addTickListener(new TickListener() {
      @Override
      public void tick(TimeLapse timeLapse) {
View Full Code Here

  public static void main(String[] args) {

    final Simulator sim = new Simulator(new MersenneTwister(123),
        Measure.valueOf(1000L, SI.MILLI(SI.SECOND)));
    sim.register(new PlaneRoadModel(new Point(0, 0), new Point(10, 10), 10));
    sim.configure();

    View.create(sim)
        .with(new RoadUserRenderer(), new PlaneRoadModelRenderer(),
            new TestPanelRenderer("LEFT", SWT.LEFT, 200),
View Full Code Here

  /**
   * Setup an environment with three vehicles and three parcels.
   */
  @Before
  public void setUp() {
    rm = new PDPRoadModel(new PlaneRoadModel(new Point(0, 0),
        new Point(10, 10), SI.KILOMETER, Measure.valueOf(300d,
            NonSI.KILOMETERS_PER_HOUR)), false);
    pm = new DefaultPDPModel(new TardyAllowedPolicy());
    mp = new TestModelProvider(new ArrayList<Model<?>>(
        Arrays.<Model<?>> asList(rm, pm)));
View Full Code Here

        .and(StopCondition.TIME_OUT_EVENT).build();
  }

  @Override
  public RoadModel createRoadModel() {
    return new PDPRoadModel(new PlaneRoadModel(MIN, MAX, getDistanceUnit(),
        MAX_SPEED), allowDiversion);
  }
View Full Code Here

  /**
   * Sets up a test scenario.
   */
  @Before
  public void setUp() {
    rm = new PDPRoadModel(new PlaneRoadModel(new Point(0, 0),
        new Point(10, 10), SI.KILOMETER, Measure.valueOf(0.1,
            NonSI.KILOMETERS_PER_HOUR)), allowDiversion);
    pm = new DefaultPDPModel(new TardyAllowedPolicy());
    final ModelProvider mp = new TestModelProvider(asList(pm, rm));
    rm.registerModelProvider(mp);
View Full Code Here

  @Before
  public void setUp() {
    sim = new Simulator(new MersenneTwister(123), Measure.valueOf(1000L,
        SI.MILLI(SI.SECOND)));
    rm = new PDPRoadModel(new PlaneRoadModel(new Point(0, 0),
        new Point(10, 10), SI.KILOMETER, Measure.valueOf(300d,
            NonSI.KILOMETERS_PER_HOUR)), false);
    pm = new DefaultPDPModel(new TardyAllowedPolicy());

    depot = new DefaultDepot(new Point(5, 5));
View Full Code Here

TOP

Related Classes of rinde.sim.core.model.road.PlaneRoadModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.