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

Assertions fail when running default settings #46

Open
schmittner opened this issue Feb 28, 2017 · 3 comments
Open

Assertions fail when running default settings #46

schmittner opened this issue Feb 28, 2017 · 3 comments

Comments

@schmittner
Copy link
Contributor

When running the default simulation with assertions enabled (-ea), two assertions fail:

java -ea -Xmx512M -cp target:lib/ECLA.jar:lib/DTNConsoleConnection.jar core.DTNSim $*

First this:

Running simulation 'default_scenario'
java.lang.AssertionError: No path from Nt2@(3253.28,2184.33) to Nt2@(1763.40,268.05). The simulation map isn't fully connected
        at movement.ShortestPathMapBasedMovement.getPath(ShortestPathMapBasedMovement.java:56)
        at core.DTNHost.setNextWaypoint(DTNHost.java:417)
        at core.DTNHost.move(DTNHost.java:395)
        at core.World.moveHosts(World.java:214)
        at core.World.update(World.java:164)
        at ui.DTNSimTextUI.runSim(DTNSimTextUI.java:29)
        at ui.DTNSimUI.start(DTNSimUI.java:77)
        at core.DTNSim.main(DTNSim.java:98)

If removed, then the second one is eventually fired:

Running simulation 'default_scenario'
java.lang.AssertionError: Already contained  a connection of t121 and t120
        at report.ContactTimesReport.addConnection(ContactTimesReport.java:74)
        at report.ContactTimesReport.hostsConnected(ContactTimesReport.java:56)
        at core.NetworkInterface.notifyConnectionListeners(NetworkInterface.java:413)
        at core.NetworkInterface.connect(NetworkInterface.java:320)
        at interfaces.SimpleBroadcastInterface.connect(SimpleBroadcastInterface.java:59)
        at interfaces.SimpleBroadcastInterface.update(SimpleBroadcastInterface.java:93)
        at core.DTNHost.update(DTNHost.java:343)
        at core.World.updateHosts(World.java:198)
        at core.World.update(World.java:167)
        at ui.DTNSimTextUI.runSim(DTNSimTextUI.java:29)
        at ui.DTNSimUI.start(DTNSimUI.java:77)
        at core.DTNSim.main(DTNSim.java:85)

Not sure why this happens, but I didn't have time to debug this.

@julianofischer
Copy link
Contributor

Hey @schmittner, could you send us the scenario file so I can try to reproduce this problem.
Thank you!

@schmittner
Copy link
Contributor Author

It's the default_scenario in the current master d7fe68e.
Just added -ea in the one.sh script and ran ./one.sh -b 1.

@julianofischer
Copy link
Contributor

Confirmed!

The method triggering the assertion is the following:

    public Path getPath() {
            Path p = new Path(generateSpeed());
            MapNode to = pois.selectDestination();

            List<MapNode> nodePath = pathFinder.getShortestPath(lastMapNode, to);

            // this assertion should never fire if the map is checked in read phase
            assert nodePath.size() > 0 : "No path from " + lastMapNode + " to " +
                    to + ". The simulation map isn't fully connected";

            for (MapNode node : nodePath) { // create a Path from the shortest path
                    p.addWaypoint(node.getLocation());
            }

            lastMapNode = to;

            return p;
    }

// this assertion should never fire if the map is checked in read phase
Sincerely, I dont know what it means.

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

2 participants