Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message upon non-existing incarnation when reloading effects #933

Open
DanySK opened this issue Dec 1, 2021 · 0 comments
Open

Comments

@DanySK
Copy link
Member

DanySK commented Dec 1, 2021

If an incarnation is no longer available when an effect is requested, an unclear error is printed:

> Task :00-minimal
10:03:42.200 [main] WARN  it.unibo.alchemist.Alchemist - Available launchers: [Alchemist headless runner, Alchemist Swing graphical simulation]
10:03:42.204 [main] WARN  it.unibo.alchemist.launch.Launcher - Alchemist Swing graphical simulation selected because Graphical effects requested, priority shifts up
10:03:43.152 [main] WARN  i.u.a.loader.m2m.SimulationModel - No seeds specified, defaulting to 0 for both scenario and simulation
10:03:43.165 [main] WARN  i.u.a.loader.m2m.SimulationModel - No environment specified, defaulting to Continuous2DEnvironment
10:03:43.185 [main] WARN  i.u.a.loader.m2m.SimulationModel - There are no displacements in the specification, the environment won't have any node
Exception in thread "main" java.util.NoSuchElementException
        at org.danilopianini.lang.ImmutableCollectionWithCurrentElement.setCurrent(ImmutableCollectionWithCurrentElement.java:111)
        at org.danilopianini.lang.ImmutableCollectionWithCurrentElement.<init>(ImmutableCollectionWithCurrentElement.java:33)
        at it.unibo.alchemist.boundary.gui.effects.EffectSerializationFactory$2.read(EffectSerializationFactory.java:63)
        at it.unibo.alchemist.boundary.gui.effects.EffectSerializationFactory$2.read(EffectSerializationFactory.java:54)
        at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:894)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
        at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:285)
        at com.google.gson.typeadapters.RuntimeTypeAdapterFactory$1.read(RuntimeTypeAdapterFactory.java:231)
        at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
        at com.google.gson.Gson.fromJson(Gson.java:932)
        at com.google.gson.Gson.fromJson(Gson.java:897)
        at it.unibo.alchemist.boundary.gui.effects.EffectSerializationFactory.effectsFromFile(EffectSerializationFactory.java:112)
        at it.unibo.alchemist.boundary.gui.SingleRunGUI.make(SingleRunGUI.java:157)
        at it.unibo.alchemist.boundary.gui.SingleRunGUI.make(SingleRunGUI.java:111)
        at it.unibo.alchemist.launch.SingleRunSwingUI.launch(SingleRunSwingUI.kt:46)
        at it.unibo.alchemist.launch.SimulationLauncher.launch(SimulationLauncher.kt:52)
        at it.unibo.alchemist.launch.Launcher.invoke(Launcher.kt:44)
        at it.unibo.alchemist.Alchemist.launch(Alchemist.kt:170)
        at it.unibo.alchemist.Alchemist.main(Alchemist.kt:128)

Reproducible at https://github.com/AlchemistSimulator/SAPERE-incarnation-tutorial/tree/5ee7ead4d51cd3acb3e0863cd3bc49a36bd07953, with ./gradlew 00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant