0

我正在尝试使用WarehouseRendererand AgvRendererfrom运行实验AgvExample

我得到以下异常:

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)
4

1 回答 1

0

此错误表明有一个渲染器连接到需要类型为 的模型的模拟器CollisionGraphRoadModel。只有存在包含需要渲染的数据的相应模型时,渲染器才能正常工作。

AgvExample以下代码中(参见第 86-90 行)用于添加所需的模型:

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

如果您想在代码中使用 ,可以添加类似WarehouseRenderer的代码。

于 2019-05-29T04:15:22.780 回答