openTCS / opentcs

The open Transportation Control System (by Fraunhofer IML)
https://www.opentcs.org/
345 stars 121 forks source link

Report points in model cause exception with resource scheduling #59

Closed swltr closed 1 year ago

swltr commented 2 years ago

Affected version

Release 5.6, possibly earlier releases, too

Steps to reproduce

  1. Create a model with at least one report point.
  2. Route a vehicle across the report point.

Expected behaviour

The vehicle traverses the report point normally.

Actual behaviour

An exception is thrown due to an inconsistency with resource scheduling:

[20221025-08:09:25-339] WARNING kernelExecutor       o.o.common.LoggingScheduledThreadPoolExecutor.afterExecute(): Unhandled exception in executed task
java.lang.IllegalArgumentException: Not the next claimed resources: [Path{name=Point-0019 --- Point-0017}, Point{name=Point-0017}]
    at org.opentcs.util.Assertions.checkArgument(Assertions.java:50)
    at org.opentcs.strategies.basic.scheduling.DefaultScheduler.allocate(DefaultScheduler.java:187)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.allocateForNextCommand(DefaultVehicleController.java:1031)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.checkForPendingCommands(DefaultVehicleController.java:938)
    at org.opentcs.kernel.vehicles.PeripheralInteractor.startPostMovementInteractions(PeripheralInteractor.java:252)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.commandExecuted(DefaultVehicleController.java:909)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.handleProcessModelEvent(DefaultVehicleController.java:780)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.propertyChange(DefaultVehicleController.java:274)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
    at org.opentcs.drivers.vehicle.VehicleProcessModel.commandExecuted(VehicleProcessModel.java:464)
    at org.opentcs.virtualvehicle.LoopbackCommunicationAdapter.finishVehicleSimulation(LoopbackCommunicationAdapter.java:406)
    at org.opentcs.virtualvehicle.LoopbackCommunicationAdapter.movementSimulation(LoopbackCommunicationAdapter.java:367)
    at org.opentcs.virtualvehicle.LoopbackCommunicationAdapter.lambda$movementSimulation$6(LoopbackCommunicationAdapter.java:351)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:830)

[20221025-08:09:32-851] WARNING kernelExecutor       o.o.common.LoggingScheduledThreadPoolExecutor.afterExecute(): Unhandled exception in executed task
java.lang.IllegalArgumentException: Not the next claimed resources: [Point{name=Point-0020}, Path{name=Point-0017 --- Point-0020}]
    at org.opentcs.util.Assertions.checkArgument(Assertions.java:50)
    at org.opentcs.strategies.basic.scheduling.DefaultScheduler.allocate(DefaultScheduler.java:187)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.allocateForNextCommand(DefaultVehicleController.java:1031)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.checkForPendingCommands(DefaultVehicleController.java:938)
    at org.opentcs.kernel.vehicles.PeripheralInteractor.startPostMovementInteractions(PeripheralInteractor.java:252)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.commandExecuted(DefaultVehicleController.java:909)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.handleProcessModelEvent(DefaultVehicleController.java:780)
    at org.opentcs.kernel.vehicles.DefaultVehicleController.propertyChange(DefaultVehicleController.java:274)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
    at org.opentcs.drivers.vehicle.VehicleProcessModel.commandExecuted(VehicleProcessModel.java:464)
    at org.opentcs.virtualvehicle.LoopbackCommunicationAdapter.finishVehicleSimulation(LoopbackCommunicationAdapter.java:406)
    at org.opentcs.virtualvehicle.LoopbackCommunicationAdapter.movementSimulation(LoopbackCommunicationAdapter.java:367)
    at org.opentcs.virtualvehicle.LoopbackCommunicationAdapter.lambda$movementSimulation$6(LoopbackCommunicationAdapter.java:351)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:830)

Additional information

Originally reported by @jfaigan in #56

swltr commented 1 year ago

@jfaigan This has just been fixed (in 680bb52d8884082a3d2ec96ce8c667c4c370f629), so I am closing this issue.