<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James Keirstead &#187; Modelling</title>
	<atom:link href="http://www.jameskeirstead.ca/category/research/modelling/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jameskeirstead.ca</link>
	<description></description>
	<lastBuildDate>Tue, 29 Nov 2011 10:58:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Linking Repast to another Java program</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/linking-repast-to-another-java-program/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/linking-repast-to-another-java-program/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 12:36:07 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>
		<category><![CDATA[agent based modelling]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[repast]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/research/modelling/linking-repast-to-another-java-program/</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Flinking-repast-to-another-java-program%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Linking Repast to another Java program" data-url="http://www.jameskeirstead.ca/dphil/modelling/linking-repast-to-another-java-program/"></a> 
			</div></div>
		<div style="clear:both;"></div><p><a href="http://repast.sourceforge.net/">Repast</a> is one of the leading software packages for agent-based simulation. It provides useful classes for building and controlling simulations and users can run their models using a graphic display or in batch mode. These functions are fairly straight-forward if you want to build a stand-alone Repast simulation but what if you want to integrate Repast within a larger modelling system? This tutorial will explain the problem and show a solution influenced by design patterns.</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/linking-repast-to-another-java-program/" class="more-link">Read more on Linking Repast to another Java program&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Flinking-repast-to-another-java-program%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Linking Repast to another Java program" data-url="http://www.jameskeirstead.ca/dphil/modelling/linking-repast-to-another-java-program/"></a> 
			</div></div>
		<div style="clear:both;"></div><p><a href="http://repast.sourceforge.net/">Repast</a> is one of the leading software packages for agent-based simulation. It provides useful classes for building and controlling simulations and users can run their models using a graphic display or in batch mode. These functions are fairly straight-forward if you want to build a stand-alone Repast simulation but what if you want to integrate Repast within a larger modelling system? This tutorial will explain the problem and show a solution influenced by design patterns.</p>
<p><span id="more-181"></span></p>
<p>Let&#8217;s assume that we have a programme that implements a number of different models. Each model extends an <code>AbstractModel</code> class, which uses the <a href="http://en.wikipedia.org/wiki/Template_method_pattern">Template</a> pattern to enforce a particular run order (e.g. <code>setup()</code>, <code>execute()</code>, <code>report()</code>). We want to create a Repast ABM that extends this class; however to take advantage of Repast&#8217;s facilities we would also like to extend the <code>SimModelImpl</code> class and our new <code>MyABM</code> class can&#8217;t have two super-classes.</p>
<p>So what can we do? One solution would be to extend the <code>AbstractModel </code>class and <em>implement</em> Repast&#8217;s <code>SimModel</code> interface. This would ensure that all the functionality is there but we would have to manually rewrite the implementations of the interface methods; this is both time-consuming and dangerous &ndash; you could have collisions between the names of the interface methods and the <code>AbstractModel</code> methods and if Repast&#8217;s code changes, you have to make sure that your implementing methods are consistent with the new code. Not ideal.</p>
<p>The solution is to separate the functionality of the <code>MyABM</code> class into two classes. In the first class, <code>MyABM</code>, we build our agent-based model as if it were a regular Repast ABM by extending the <code>SimModelImpl</code> class. We can even add a <code>main(args[])</code> method so that it can be run on its own. We then create a second class, <code>MyABMController</code>, which extends <code>AbstractModel</code>. This class implements the template methods needed to actually run the model. The key to this structure is that both <code>MyABM</code> and <code>MyABMController</code> contain a reference to one another. The class diagram is something like this:</p>
<p><img src='http://www.jameskeirstead.ca/wordpress/wp-content/uploads/2007/11/classes.png' alt='Class diagram' /></p>
<p>In the code example below, I will assume that <code>MyABM </code> will be run as a batch model (i.e. no GUI). Remember that the <code>AbstractModel</code> class requires subclasses to implement an <code>execute()</code> method; the relevant code in <code>MyABMController</code> to call our ABM is therefore:<br />
<code><br />
public void execute() {<br />
&nbsp;SimInit init = new SimInit();<br />
&nbsp;MyABM model = new MyABM(this);<br />
&nbsp;init.loadModel(model, "params.txt", true);<br />
}<br />
</code></p>
<p>Note that the constructor for the model requires a reference back to the controller. This is then used by MyABM to retrieve data from the rest of the model, e.g. when initialise agents and spaces or other data.</p>
<p>If you run this code, you&#8217;ll notice a problem though. Because our simulation is running as a batch model, the user can&#8217;t press a button to make the run stop. This needs to be explicitly scheduled in <code>MyABM</code>&#8216;s <code>buildSchedule </code> method (see <a href="http://www.u.arizona.edu/~jtmurphy/H2R/HowTo00.htm">this tutorial</a> for more information). While a simple call to the inherited <code>stop()</code> method will stop the model, it also stops the entire Java VM including our calling environment. Therefore we need to add an extra line telling the <a href="http://supportweb.cs.bham.ac.uk/docs/java/repast/api/uchicago/src/sim/engine/IController.html">IController</a> not to stop everything when the model finishes. The scheduling code block is something like this, with <code>nTicks</code> representing the desired number of ticks before the model stops.<br />
<code><br />
class StopModel extends BasicAction {<br />
&nbsp;public void execute(){<br />
&nbsp;&nbsp;// ensure that Java stays running<br />
&nbsp;&nbsp;getController().setExitOnExit(false);<br />
&nbsp;&nbsp;// stop the model<br />
&nbsp;&nbsp;stop();<br />
&nbsp;}<br />
}<br />
int nTicks = 1000;<br />
schedule.scheduleActionAt(nTicks, new StopModel(), Schedule.LAST);<br />
</code><br />
You&#8217;ll now be returned to your original calling environment in <code>MyABMController</code>.<br />
<code><br />
public void execute() {<br />
&nbsp;SimInit init = new SimInit();<br />
&nbsp;MyABM model = new MyABM(this);<br />
&nbsp;init.loadModel(model, "params.txt", true);</p>
<p>&nbsp;// Back from Repast!<br />
&nbsp;System.out.println("Welcome back!");<br />
}<br />
</code></p>
<p>I&#8217;m not sure if this solution is actually an example of a <a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)">design pattern</a> but it does apply some of the same principles. It works though and that&#8217;s the main thing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/linking-repast-to-another-java-program/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fun with Pajek</title>
		<link>http://www.jameskeirstead.ca/dphil/fun-with-pajek/</link>
		<comments>http://www.jameskeirstead.ca/dphil/fun-with-pajek/#comments</comments>
		<pubDate>Wed, 10 May 2006 20:33:41 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pajek]]></category>
		<category><![CDATA[pv]]></category>
		<category><![CDATA[solar]]></category>
		<category><![CDATA[UK]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/?p=82</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Ffun-with-pajek%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Fun with Pajek" data-url="http://www.jameskeirstead.ca/dphil/fun-with-pajek/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I&#8217;m working on the conclusion chapter of my thesis at the moment.  It&#8217;s meant to sum up the results presented in earlier chapters and then discuss wider questions in the literature and for policy.  There are a couple ideas I&#8217;m working on, such as an ideal tariff for microgenerators and clarifying PV&#8217;s place within the context of other household energy conservation measures, but a basic concern is sorting out how PV households interact with other stakeholders within the PV industry.  </p>
<p><a href="http://www.jameskeirstead.ca/dphil/fun-with-pajek/" class="more-link">Read more on Fun with Pajek&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Ffun-with-pajek%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Fun with Pajek" data-url="http://www.jameskeirstead.ca/dphil/fun-with-pajek/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I&#8217;m working on the conclusion chapter of my thesis at the moment.  It&#8217;s meant to sum up the results presented in earlier chapters and then discuss wider questions in the literature and for policy.  There are a couple ideas I&#8217;m working on, such as an ideal tariff for microgenerators and clarifying PV&#8217;s place within the context of other household energy conservation measures, but a basic concern is sorting out how PV households interact with other stakeholders within the PV industry.  </p>
<p>I wasn&#8217;t really sure how to start answering this question until a friend told me about <a href="http://vlado.fmf.uni-lj.si/pub/networks/pajek/">Pajek</a>.  It&#8217;s a bit of software that can be used to analyse large social networks and it will perform all sorts of calculations.  The options can be a bit confusing though so I thought I&#8217;d start simple.  I entered some data from my interviews and you can see the resulting plot below.  The size of the dots represents the ability of each node to control the network (inverse of dyadic constraint if you&#8217;re interested).</p>
<p><img alt="UK PV actor network" src="http://www.jameskeirstead.ca/photos/misc/PVnetwork.png" /></p>
<p>This is only a first draft but reassuringly, some basic things like a strong connection between PV households, electricity suppliers and PV installers can be seen.  It also seems to show that the DTI and Ofgem play a major role behind the scenes, framing the interactions of other stakeholders.  This came out of the interviews as well but the advantage of the network graph is that it&#8217;s immediately clear that there is no direct link between households and these government agencies.  So, for example, if we want PV households to become more active participants in the electricity network &ndash; i.e. exporting electricity at times when it&#8217;s good for the grid or generally reducing demand &ndash; then the graph suggests that perhaps a link between DTI, Ofgem and the households needs to be built.  This might be achieved by developing a pilot programme with innovative metering and monitoring technologies, working in conjunction with the electricity suppliers and PV installers.  As it happens, there has actually <a href="http://www.ofgem.gov.uk/ofgem/work/index.jsp?section=/areasofwork/metering">been talk</a> of <a href="http://www.sustainabilityfirst.org.uk/publications.php" >doing just that</a>!</p>
<p>That&#8217;s a pretty rough sketch of course but I&#8217;m keen to play with Pajek a bit more and see what I else I might be able to find out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/fun-with-pajek/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HSQLDB</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/hsqldb/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/hsqldb/#comments</comments>
		<pubDate>Thu, 19 May 2005 16:29:10 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=32</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fhsqldb%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="HSQLDB" data-url="http://www.jameskeirstead.ca/dphil/modelling/hsqldb/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>As I was saying last time, I&#8217;ve got quite a bit of configuration data used in the model and I couldn&#8217;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.</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/hsqldb/" class="more-link">Read more on HSQLDB&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fhsqldb%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="HSQLDB" data-url="http://www.jameskeirstead.ca/dphil/modelling/hsqldb/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>As I was saying last time, I&#8217;ve got quite a bit of configuration data used in the model and I couldn&#8217;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.</p>
<p>So I was poking around on the web trying to find a solution and came across <a href="http://hsqldb.sourceforge.net/">HSQLDB.</a> 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&#8217;s right &#8211; 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&#8217;s really fast but any changes to the database are lost when the model finishes. At the moment that&#8217;s fine but I may add something to periodically write to file.</p>
<p>That&#8217;s another sub-version done. Things are coming along quite nicely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/hsqldb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data storage and manipulation</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/data-storage-and-manipulation/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/data-storage-and-manipulation/#comments</comments>
		<pubDate>Sat, 14 May 2005 16:00:13 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=31</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fdata-storage-and-manipulation%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Data storage and manipulation" data-url="http://www.jameskeirstead.ca/dphil/modelling/data-storage-and-manipulation/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I&#8217;m making good progress on the next version of the model, adding more configuration information for the initialization of household agents. However I&#8217;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&#8217;s very easy to see what&#8217;s going on, add comments and share information &#8211; everyone&#8217;s got Notepad but not everyone has the latest MySQL setup.</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/data-storage-and-manipulation/" class="more-link">Read more on Data storage and manipulation&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fdata-storage-and-manipulation%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Data storage and manipulation" data-url="http://www.jameskeirstead.ca/dphil/modelling/data-storage-and-manipulation/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I&#8217;m making good progress on the next version of the model, adding more configuration information for the initialization of household agents. However I&#8217;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&#8217;s very easy to see what&#8217;s going on, add comments and share information &#8211; everyone&#8217;s got Notepad but not everyone has the latest MySQL setup.</p>
<p>But once the data&#8217;s in from the file I&#8217;ve got another problem about how to store it. At the moment, I&#8217;ve defined many of my finite data categories as enum types. For example, households can either be <code>FAMILY</code> or <code>RETIRED.</code> This works great in some respects: I can use the fast EnumMap to store data and it makes iterating very easy. Of course, enum&#8217;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 &#8211; 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.</p>
<p>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?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/data-storage-and-manipulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 0.3 finished</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/version-03-finished/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/version-03-finished/#comments</comments>
		<pubDate>Tue, 10 May 2005 17:13:21 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=30</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fversion-03-finished%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Version 0.3 finished" data-url="http://www.jameskeirstead.ca/dphil/modelling/version-03-finished/"></a> 
			</div></div>
		<div style="clear:both;"></div><p> Last week I finished the first version of my model and I&#8217;m pretty pleased with how it works so far.</p>
<p>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&#8217;t know what the outcome of a particular method might be. To get around this, I&#8217;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.</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/version-03-finished/" class="more-link">Read more on Version 0.3 finished&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fversion-03-finished%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Version 0.3 finished" data-url="http://www.jameskeirstead.ca/dphil/modelling/version-03-finished/"></a> 
			</div></div>
		<div style="clear:both;"></div><p> Last week I finished the first version of my model and I&#8217;m pretty pleased with how it works so far.</p>
<p>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&#8217;t know what the outcome of a particular method might be. To get around this, I&#8217;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.</p>
<p>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.</p>
<p>PS In case anyone&#8217;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&#8230;). I&#8217;ve tried to map out the version numbers so that they&#8217;ll make some sense, at least in hindsight. For the moment I&#8217;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.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/version-03-finished/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modelling load profiles</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/modelling-load-profiles/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/modelling-load-profiles/#comments</comments>
		<pubDate>Thu, 28 Apr 2005 15:51:14 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=29</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fmodelling-load-profiles%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Modelling load profiles" data-url="http://www.jameskeirstead.ca/dphil/modelling/modelling-load-profiles/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I&#8217;ve been trying to figure out how to model load profiles for different appliances. There are a few different approaches but the most sensible approach begins by assuming that, for an appliance to be used:</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/modelling-load-profiles/" class="more-link">Read more on Modelling load profiles&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fmodelling-load-profiles%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Modelling load profiles" data-url="http://www.jameskeirstead.ca/dphil/modelling/modelling-load-profiles/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I&#8217;ve been trying to figure out how to model load profiles for different appliances. There are a few different approaches but the most sensible approach begins by assuming that, for an appliance to be used:</p>
<ul>
<li>the household needs to be occupied (i.e. somebody&#8217;s home)</li>
<li>the household occupant wants to use the appliance (a desired activity)</li>
<li>the activity requires a certain appliance</li>
</ul>
<p>There are some different ways to allocate the precise timing but I think I&#8217;m going to simplify this approach. I&#8217;ll test it and then if that doesn&#8217;t work I&#8217;ll try something different. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/modelling-load-profiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeZoo</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/codezoo/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/codezoo/#comments</comments>
		<pubDate>Sat, 16 Apr 2005 13:08:37 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=28</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fcodezoo%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="CodeZoo" data-url="http://www.jameskeirstead.ca/dphil/modelling/codezoo/"></a> 
			</div></div>
		<div style="clear:both;"></div><p> I just came across <a href="http://www.codezoo.com/">CodeZoo,</a> which is a recently launched site with free libraries for a whole bunch of standard tasks. It looks like it should be really useful &#8211; just a quick browse brings up all sorts of things that I might want to use.</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/codezoo/" class="more-link">Read more on CodeZoo&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fcodezoo%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="CodeZoo" data-url="http://www.jameskeirstead.ca/dphil/modelling/codezoo/"></a> 
			</div></div>
		<div style="clear:both;"></div><p> I just came across <a href="http://www.codezoo.com/">CodeZoo,</a> which is a recently launched site with free libraries for a whole bunch of standard tasks. It looks like it should be really useful &#8211; just a quick browse brings up all sorts of things that I might want to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/codezoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fancy math</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/fancy-math/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/fancy-math/#comments</comments>
		<pubDate>Thu, 14 Apr 2005 09:14:45 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=26</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Ffancy-math%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Fancy math" data-url="http://www.jameskeirstead.ca/dphil/modelling/fancy-math/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I came across another interesting article on simulating load profiles and this one suggests using principal components analysis and some regression. I had a go with it yesterday and managed to get a pretty good approximation using one year of electricity demand data at hourly interval. Running princomp in R, I picked three components out of 24 and that covers 98% of the variance. Check it out (click for bigger):</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/fancy-math/" class="more-link">Read more on Fancy math&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Ffancy-math%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Fancy math" data-url="http://www.jameskeirstead.ca/dphil/modelling/fancy-math/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I came across another interesting article on simulating load profiles and this one suggests using principal components analysis and some regression. I had a go with it yesterday and managed to get a pretty good approximation using one year of electricity demand data at hourly interval. Running princomp in R, I picked three components out of 24 and that covers 98% of the variance. Check it out (click for bigger):</p>
<p><a href="http://www.jameskeirstead.ca/photos/misc/PCA_load_small.jpg"><img width=450 src="http://www.jameskeirstead.ca/photos/misc/PCA_load_small.jpg" alt="PCA analysis of domestic electricity consumption" /></a></p>
<p>The next step is to add some exogenous variables and see if I can generate new curves given likely temperatures, days of the week, holidays and so on. I&#8217;ll have to brush up on my matrix math a bit first though. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/fancy-math/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New mail!</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/new-mail/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/new-mail/#comments</comments>
		<pubDate>Mon, 04 Apr 2005 12:34:36 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=27</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fnew-mail%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="New mail!" data-url="http://www.jameskeirstead.ca/dphil/modelling/new-mail/"></a> 
			</div></div>
		<div style="clear:both;"></div><p> I ordered a copy of <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0596007736/qid=1112617895/sr=1-1/ref=sr_1_1/103-7617998-5231010?v=glance&#038;s=books">Java in a Nutshell</a> a couple months ago and it finally arrived today. It looks pretty good but as my office mates pointed out, what size nutshell are they referring to? The thing weighs in at over 1200 pages!</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/new-mail/" class="more-link">Read more on New mail!&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fnew-mail%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="New mail!" data-url="http://www.jameskeirstead.ca/dphil/modelling/new-mail/"></a> 
			</div></div>
		<div style="clear:both;"></div><p> I ordered a copy of <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0596007736/qid=1112617895/sr=1-1/ref=sr_1_1/103-7617998-5231010?v=glance&#038;s=books">Java in a Nutshell</a> a couple months ago and it finally arrived today. It looks pretty good but as my office mates pointed out, what size nutshell are they referring to? The thing weighs in at over 1200 pages!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/new-mail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Integrated models</title>
		<link>http://www.jameskeirstead.ca/dphil/modelling/integrated-models/</link>
		<comments>http://www.jameskeirstead.ca/dphil/modelling/integrated-models/#comments</comments>
		<pubDate>Wed, 30 Mar 2005 11:52:44 +0000</pubDate>
		<dc:creator>James Keirstead</dc:creator>
				<category><![CDATA[Modelling]]></category>

		<guid isPermaLink="false">http://www.jameskeirstead.ca/wordpress/?p=24</guid>
		<description><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fintegrated-models%2F&#38;layout=button_count&#38;show_faces=false&#38;width=100&#38;action=like&#38;colorscheme=light&#38;send=false&#38;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Integrated models" data-url="http://www.jameskeirstead.ca/dphil/modelling/integrated-models/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I recently submitted a paper which said that an integrated model of domestic energy consumption is desperately needed. What&#8217;s more, I said that it didn&#8217;t look as though anyone else was really working on something like this. Turns out I was only partly right &#8211; people are working on integrated models, they&#8217;re just not integrating them with each other.</p>
<p><a href="http://www.jameskeirstead.ca/dphil/modelling/integrated-models/" class="more-link">Read more on Integrated models&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share"><div style="width:100px;" class="really_simple_share_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.jameskeirstead.ca%2Fdphil%2Fmodelling%2Fintegrated-models%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="width:110px;" class="really_simple_share_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Integrated models" data-url="http://www.jameskeirstead.ca/dphil/modelling/integrated-models/"></a> 
			</div></div>
		<div style="clear:both;"></div><p>I recently submitted a paper which said that an integrated model of domestic energy consumption is desperately needed. What&#8217;s more, I said that it didn&#8217;t look as though anyone else was really working on something like this. Turns out I was only partly right &#8211; people are working on integrated models, they&#8217;re just not integrating them with each other.</p>
<p>The idea of the paper was that if people could get behind one way of discussing domestic energy consumption, refering to its different constituent parts, and exploring the links between these parts, energy researchers would be better off. Research from one discipline could be used in another by using such a framework to put things in context. People would be speaking the same language and even if things weren&#8217;t perfect, it would be a big step forward.</p>
<p>These other projects that I&#8217;ve recently come across (CARB and Tyndall&#8217;s CIAM) seem to be going down the same path but in different directions. Both are trying to integrate the complexities of energy consumption (not just in the domestic sector) but they seem to be struggling to find this sort of common language. To be fair, both projects have slightly different aims and they have only begun recently and perhaps they&#8217;ve tried to find a common language and decided against it.</p>
<p>I realize that might come across wrong so let me clarify the two points I&#8217;m trying to make:</p>
<ol>
<li>It&#8217;s great that other people are trying to develop an integrated model of energy consumption. Funny that everyone seems to be getting the same idea all at once but the more the merrier I see and hopefully something will come of it.
</li>
<li> However given all the effort that has been and will be invested in these two projects, some effort should be made to reduce overlap and present them in a compatible way. I don&#8217;t think multiple &#8220;integrated&#8221; models are terribly useful by definition &#8211; there should at least be some degree of theoretical compatibility between integrated models.
</li>
</ol>
<p>This doesn&#8217;t mean that what I&#8217;m working on is an ideal third way. These other projects, like my work, is just starting and so I&#8217;m very keen to see how they progress. Given my flexibility as a doctoral student, I hope that I will be able to learn from these two projects, build a theoretical foundation and present a model which I feel is suitable for the integrated analysis of energy consumption.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jameskeirstead.ca/dphil/modelling/integrated-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

