I’m making good progress on the next version of the model, adding more configuration information for the initialization of household agents. However I’m having difficulty deciding on a common file format so that I can have just one or two methods for reading in files and parsing them into appropriate input. Some of my files have two or three columns, some labelled rows, some just single numeric values. In some ways it would be easier if everything was in a database but I kind of like using text files since it’s very easy to see what’s going on, add comments and share information – everyone’s got Notepad but not everyone has the latest MySQL setup.
But once the data’s in from the file I’ve got another problem about how to store it. At the moment, I’ve defined many of my finite data categories as enum types. For example, households can either be FAMILY or RETIRED. This works great in some respects: I can use the fast EnumMap to store data and it makes iterating very easy. Of course, enum’s are final static so if I want to expand the range of enum types I need to edit the source. Adding extra types also has implications for the text file inputs – again it might be easier if everything was done with databases since I could just add fields and so on as new data types are added.
Any thoughts on how might be the best way to manipulate this type of data? Am I going to have to bite the bullet and move away from text files?
