Print

Print


Hi,

I'm using GeoMason to make a city simulation (agents walking along roads
between houses) but might have come across a bug. I want to get the road
network (a sim.​field.​network.Network object) from the field (a sim.​util.​
geo.​GeomPlanarGraph object) to find out if the graph is connected or not.

But the call to 'network.getNetwork()' causes the ClassCastException below.
You can re-create this bug in CampusWorld but putting 
'network.getNetwork();' anywhere (e.g. I currently have it as the first
thing to be done after the super.start() call in the CampusWorld.start()
method). See the output from CapusWorld below.

Any ideas?

Thanks,
Nick


MASON Version 17.  For further options, try adding ' -help' at end.
reading buildings layer
reading roads layer
reading walkways layer
Done reading data
Job: 0 Seed: -648980294
Starting sim.app.geo.campusworld.CampusWorld
Exception in thread "MASON Model: class sim.app.geo.campusworld.CampusWorld"
java.lang.ClassCastException: sim.util.geo.GeomPlanarGraphEdge cannot be
cast to com.vividsolutions.jts.planargraph.DirectedEdge
	at sim.util.geo.GeomPlanarGraph.getNetwork(GeomPlanarGraph.java:151)
	at sim.app.geo.campusworld.CampusWorld.start(CampusWorld.java:162)
	at sim.engine.SimState.doLoop(SimState.java:545)
	at sim.engine.SimState.doLoop(SimState.java:342)
	at sim.app.geo.campusworld.CampusWorld.main(CampusWorld.java:202)
Java Result: 1