Package rinde.sim.core.model

Examples of rinde.sim.core.model.ModelProvider


  @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
      public <T extends Model<?>> T getModel(Class<T> clazz) {
        return (T) rm;
      }
View Full Code Here


  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);
    pm.registerModelProvider(mp);

    dp1 = create(new Point(1, 0), new Point(0, 7));
    dp2 = create(new Point(5, 0), new Point(0, 5));
View Full Code Here

    public T build() {
      PDPRoadModel rm = roadModel;
      PDPModel pm = pdpModel;
      if (rm == null || pm == null) {
        // in this case we need a model provider
        ModelProvider mp = modelProvider;
        if (mp == null) {
          checkArgument(
              simulator != null,
              "Attempt to find a model provider failed. Either provide the models directly, provide a model provider or a simulator.");
          mp = simulator.getModelProvider();
        }

        if (rm == null) {
          rm = mp.getModel(PDPRoadModel.class);
        }
        if (pm == null) {
          pm = mp.getModel(PDPModel.class);
        }
      }

      SimulatorAPI sapi = simulatorApi;
      if (sapi == null) {
View Full Code Here

  protected void init(boolean register) {
    rm = new PDPRoadModel(new PlaneRoadModel(new Point(0, 0),
        new Point(10, 10), 30d), diversionIsAllowed);

    pm = new DefaultPDPModel(new TardyAllowedPolicy());
    @SuppressWarnings("unchecked")
    final ModelProvider mp = new TestModelProvider(new ArrayList<Model<?>>(
        asList(rm, pm)));
    rm.registerModelProvider(mp);
    pm.registerModelProvider(mp);
View Full Code Here

TOP

Related Classes of rinde.sim.core.model.ModelProvider

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.