Spatial Interaction Modelling: Structuring into methods
[Practical 5 of 11]


This practical is going to build on the spatial interaction model code design that was implemented in the Spatial Interaction Modelling: Core ideas. We will continue using the Netbeans IDE and explore a some more of it's features which make our lives as programmers easier.

The main drive of this practical will be to adjust the code we previously wrote for our spatial interaction model to make it more robust and reusable, a process called refactoring.


Spatial Interaction Model Review:

In the previous practical we built a basic spatial interaction model. The model contained two parameters which could only be changed by altering the code (hard coded), it was based on hard coded data and had no means of assessing fit against observed data for model calibration. Despite these flaws, we managed to get a spatial model functional in a few relatively quick steps.

The model code is currently all in one class. The task undertaken in this practical is to refactor that single class into a more elegant structure consisting of multiple classes each with a specific purpose. This will allow more flexibility to incorporate the other features such as flexible data loading, model calibration and assessment as we move forward in the course.


Continue to part 1 of the practical