0

I am trying to run experiments using the WarehouseRenderer and AgvRenderer from AgvExample.

I get the following exception:

Exception in thread "main" java.lang.IllegalArgumentException: Could not resolve dependency for implementations of interface com.github.rinde.rinsim.core.model.road.CollisionGraphRoadModel, as requested by WarehouseRenderer.builder().
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:437)
    at com.github.rinde.rinsim.core.model.DependencyResolver.constructDependencyGraph(DependencyResolver.java:90)
    at com.github.rinde.rinsim.core.model.DependencyResolver.resolve(DependencyResolver.java:115)
    at com.github.rinde.rinsim.core.model.ModelManager$Builder.build(ModelManager.java:268)
    at com.github.rinde.rinsim.core.Simulator.<init>(Simulator.java:88)
    at com.github.rinde.rinsim.core.Simulator$Builder.build(Simulator.java:347)
    at com.github.rinde.rinsim.experiment.Experiment.init(Experiment.java:191)
    at com.github.rinde.rinsim.experiment.Experiment.perform(Experiment.java:195)
    at com.github.rinde.rinsim.experiment.LocalComputer$ExperimentRunner.call(LocalComputer.java:202)
    at com.github.rinde.rinsim.experiment.LocalComputer$ExperimentRunner.call(LocalComputer.java:193)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:258)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
    at com.github.rinde.rinsim.experiment.LocalComputer.compute(LocalComputer.java:81)
    at com.github.rinde.rinsim.experiment.Experiment$Builder.perform(Experiment.java:684)
    at com.github.rinde.rinsim.experiment.Experiment$Builder.perform(Experiment.java:703)
    at agv.ExperimentExample.main(ExperimentExample.java:197)
rinde
  • 1,181
  • 1
  • 8
  • 20

1 Answers1

0

This error indicates that there is a renderer attached to the simulator that expects a model of type CollisionGraphRoadModel. A renderer can only function correctly if there is a corresponding model that contains the data that needs to be rendered.

In AgvExample the following code (see lines 86-90) is used to add the required model:

.addModel(
  RoadModelBuilders.dynamicGraph(GraphCreator.createSimpleGraph())
    .withCollisionAvoidance()
    .withDistanceUnit(SI.METER)
    .withVehicleLength(VEHICLE_LENGTH))

You can add similar code if you want to use the WarehouseRenderer in your code.

rinde
  • 1,181
  • 1
  • 8
  • 20
  • Can you provide more context as to why this error is occurring? Does the AgvExample not work for you out of the box? – rinde May 30 '19 at 02:30