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

Simulation interaction with mixed graphstream / non-gs deployments is broken #820

Open
DanySK opened this issue May 18, 2021 · 0 comments
Open

Comments

@DanySK
Copy link
Member

DanySK commented May 18, 2021

Original file:

incarnation: protelis

network-model:
  type: ConnectWithinDistance
  parameters: [1]

_programs: &programs
  - time-distribution: 1 # This is a frequency
    program: "org:protelis:tutorial:distanceTo"
  - program: send


deployments:
  - type: Grid
    parameters: [-5, -5, 5, 5, 0.5, 0.5, 0.2, 0.2]
    contents:
      - molecule: "source"
        concentration: true
        in:
          type: Circle
          parameters: [0, 0, 0.3]          
    programs: *programs
  - type: GraphStreamDeployment
    parameters: [200, 4, 4, 0.5, "Lobster", [10, 4]]
    programs: *programs
_my_custom_entry:
  1. Run the simulation
  2. Select and move a bunch of nodes from the top right of the grid
  3. Simulator crashes with:
10:49:07.230 [main] ERROR i.u.a.core.implementations.Engine - The simulation engine crashed.
java.lang.IndexOutOfBoundsException: Node -6 does not exist
        at org.graphstream.graph.implementations.AdjacencyListGraph.getNode(AdjacencyListGraph.java:247)
        at it.unibo.alchemist.model.implementations.linkingrules.OffsetGraphStreamLinkingRule.computeNeighborhood(OffsetGraphStreamLinkingRule.kt:30)
        at it.unibo.alchemist.model.implementations.linkingrules.CombinedLinkingRule$computeNeighborhood$1.invoke(CombinedLinkingRule.kt:32)
        at it.unibo.alchemist.model.implementations.linkingrules.CombinedLinkingRule$computeNeighborhood$1.invoke(CombinedLinkingRule.kt:22)
        at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:315)
        at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303)
        at com.google.common.collect.Iterators.addAll(Iterators.java:355)
        at com.google.common.collect.Iterables.addAll(Iterables.java:320)
        at org.danilopianini.util.ImmutableListSet$Builder.addAll(ImmutableListSet.java:49)
        at it.unibo.alchemist.model.implementations.neighborhoods.SimpleNeighborhood.<init>(SimpleNeighborhood.kt:33)
        at it.unibo.alchemist.model.implementations.neighborhoods.Neighborhoods$Companion.make(Neighborhoods.kt:32)
        at it.unibo.alchemist.model.implementations.linkingrules.CombinedLinkingRule.computeNeighborhood(CombinedLinkingRule.kt:28)
        at it.unibo.alchemist.model.implementations.linkingrules.CombinedLinkingRule.computeNeighborhood(CombinedLinkingRule.kt:22)
        at it.unibo.alchemist.model.implementations.environments.AbstractEnvironment.updateNeighborhood(AbstractEnvironment.java:487)
        at it.unibo.alchemist.model.implementations.environments.Abstract2DEnvironment.moveNodeToPosition(Abstract2DEnvironment.java:118)
        at it.unibo.alchemist.model.implementations.environments.Continuous2DEnvironment.moveNodeToPosition(Continuous2DEnvironment.kt:105)
        at it.unibo.alchemist.model.implementations.environments.Continuous2DEnvironment.moveNodeToPosition(Continuous2DEnvironment.kt:30)
        at it.unibo.alchemist.boundary.monitors.Generic2DDisplay$MouseManager.lambda$mouseReleased$1(Generic2DDisplay.java:874)
        at it.unibo.alchemist.core.implementations.Engine.processCommand(Engine.java:352)
        at it.unibo.alchemist.core.implementations.Engine.run(Engine.java:396)
        at it.unibo.alchemist.launch.SingleRunSwingUI.launch(SingleRunSwingUI.kt:48)
        at it.unibo.alchemist.launch.SimulationLauncher.launch(SimulationLauncher.kt:52)
        at it.unibo.alchemist.launch.Launcher$DefaultImpls.invoke(Launcher.kt:44)
        at it.unibo.alchemist.launch.AbstractLauncher.invoke(AbstractLauncher.kt:15)
        at it.unibo.alchemist.Alchemist.launch(Alchemist.kt:170)
        at it.unibo.alchemist.Alchemist.main(Alchemist.kt:128)
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