Conferences
I will be presenting some of my early results at the World Renewable Energy Congress in Aberdeen next week, focusing on the monitoring aspects of domestic PV. The week after, I will be presenting some of the possible motivations for behavioural responses to PV at the European Council for an Energy Efficient Economy’s annual Summer Study in southern France. Copies of the papers are available in the results section.
HSQLDB
As I was saying last time, I’ve got quite a bit of configuration data used in the model and I couldn’t figure out a good way to access it quickly and without too much coding. After the EnumMap stuff (which works fine but gets a bit cumbersome if you try and do anything to fancy), I switched to a JDBC connection to Access. Again it works fine but because of how frequently the database needs to be checked, it ends up being really slow.
So I was poking around on the web trying to find a solution and came across HSQLDB. Bit of a mouthful I know, but it really is a fantastic solution to this problem. Why? Because it lets you create an SQL style internal database. That’s right – at the start of my model I load everything in from the Access database, make a copy of it in RAM using HSQLDB, and then use that copy for the rest of the model run. It’s really fast but any changes to the database are lost when the model finishes. At the moment that’s fine but I may add something to periodically write to file.
That’s another sub-version done. Things are coming along quite nicely.
Data storage and manipulation
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?
Version 0.3 finished
Last week I finished the first version of my model and I’m pretty pleased with how it works so far.
There are twp issues worth noting though. JUnit was and is invaluable in developing the model but since my model uses a lot of random numbers it can be tricky to write the assert cases since you don’t know what the outcome of a particular method might be. To get around this, I’ve created dummy input files with binary (0 or 1) input data. Ordinarily these values would be a probability between 0 and 1 but with the test input, I know definitely what the model is doing at any stage.
The other one is that the model outputs its results to a text file as it goes along. This makes it kind of tricky to write a JUnit test. Perhaps there is some way of doing this but for the moment I just output everything to a file and look at it manually to see if the data makes sense.
PS In case anyone’s wondering about the version numbers. V0.1 was a dummy version, just playing around with Repast and Eclipse. V0.2 was a more serious attempt and had a few interesting features liking reading in input from a proper database (well Access…). I’ve tried to map out the version numbers so that they’ll make some sense, at least in hindsight. For the moment I’m planning on adding features to the basic model for the 0.3x releases. I think V0.4 will introduce the all of the remaining agents, though they may not be fully implemented.
Industry interviews
Members of the UK PV industry are currently being contacted to solicit their opinions on the key issues raised during the recent household interviews. If you have not been contacted but feel you or your firm has something to add to the research, please get in touch using the contact information on the side of this page.