MASON-INTEREST-L Archives

April 2018

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0
Content-Type:
text/plain; charset="UTF-8"
Date:
Sun, 29 Apr 2018 11:57:18 -0400
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
Content-Transfer-Encoding:
8bit
Message-ID:
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
From:
Brant Horio <[log in to unmask]>
Parts/Attachments:
text/plain (65 lines)
Hi all, 

A quick geoMason question. I have a Fairfax county shapefile (downloaded from the county) with a point layer for households, both of which are in the same projection and all multishapes removed. I'm running MASON v19 and the I think the latest geoMASON. I have a bare bones program where I'm just trying to get the shapefile read in, but I keep getting errors, for example:

MASON Version 19.  For further options, try adding ' -help' at end.
Exception in thread "Thread-0" java.lang.RuntimeException: Exception occurred while trying to construct the simulation class model.VaxHedge_Controller
java.lang.reflect.InvocationTargetException
	at sim.engine.SimState$1.newInstance(SimState.java:365)
	at sim.engine.SimState$2.run(SimState.java:608)
	at java.lang.Thread.run(Unknown Source)

The code for this is super simple and tractable, attached here. Any thoughts on why this error and what it means? I've searched for it on Google, but nothing seemed to be useful for this. Many thanks for any advice!!

CODE:

package model;

import java.io.FileNotFoundException;

import sim.engine.SimState;
import sim.field.geo.GeomVectorField;
import sim.io.geo.ShapeFileImporter;

public class VaxHedge_Controller extends SimState
{
	public int width = 800;
	public int height = 800;
	
	public GeomVectorField zips = new GeomVectorField(width, height);
	
	/**
	 * Constructor.
	 * @param seed
	 */
	public VaxHedge_Controller(long seed)
	{
		super(seed);
		
		readData();
	}
	
	/**
	 * Load in shapefiles and other initialization data.
	 */
	private void readData()
	{
		// read shapefile data
		try 
		{
			ShapeFileImporter.read(VaxHedge_Controller.class.getResource("data/ZipCodes_WGS84.shp"), zips);
		} 
		catch (FileNotFoundException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args)
	{
		doLoop(VaxHedge_Controller.class, args);
		System.exit(0);
	}
}

ATOM RSS1 RSS2