This is an old revision of the document!
CDM-S Extended
This page will be an overview on what was our experience in iterating through the CDM-s steps.
We've been given a ready to use set of models with already defined objective.
The main question is “How does the initial allocation of carbon quotas and the rules governing their trade influence the distribution and total release of carbon?”.
In the second step we needed to answer to the following questions:
- What is the data: The data is the whole behavior of the simulation. We are interested in statistics and all the numbers.
- Where is the data: Those numbers and statistic values are held within the messages. Listening to all of them with a module is enough to have all the information we need to answer to the main topic.
- How is it shared: The data is shared through the network and with messages with the use of the Blackboard system architecture.
- How is it processed/changed: The data is processed inside all the modules. All of them have tasks to do meanwhile they are exchanging messages with the other modules. The system will evolve itself just using its modules and their simple functions.
This accomplish the first two steps of the CDM-s in which we should define objectives and questions to answer to during and at the end of the simulation.
In step 3 we had to define:
- Modules: this was given in the beginning with the specification of objective and the roughly defined modules.
- Blackboards: our blackboard architecture is implemented with a single WhiteBoard (naming by Psyclone framework) that is our Market. This is the most rational decision since in a double auction market the first functionality is to run a market accepting all the requests by the industries.
- Unit tests: we used a unit test in the beginning to troubleshoot the initial weird behavior that we were getting from the first implementation. This was really helpful for having a robust skeleton of the system before starting improving the rest of the functionality.
Step 4: the fun starts here..
This was one of the hardest step to go through because all the debugging, troubleshooting and important decision were made in this step after experiencing all the possible behaviors of the system.
We got stuck on this step because most of the important decision/problems are supposed to come up here.
- Expected communications: obviously we were really far from the expected system. Our modules were drowning the WhiteBoard because they were too fast to post messages and then some of the modules or even the Market were crashing. The solution was just slowing down the speed of the modules with a timer that allows all the publication/subscription to be successfully.
- Efficient information flow: this part was really helpful once improved. We needed to have a lot of information to be exchanged among the modules and we started giving static hardcoded parameters, then we moved to the command line options and then again we throwed all the “variable” values to the psySpec file as it is really easy to configure.
- Convenience with regard to programming languages and executables: we decided according to the teacher to use java because of its portability (and also because of the skills of most of the students). It could have been really an effort to use a c/c++ environment since we are three different users (mac, linux, windows), and again because we could have used a lot of code from the last year simulation. So the choice of using java was the most obvious.
First Iteration through 1-4 steps
Here comes the first break in the CDM-s flow. We needed to rethink something in the step 3.a and especially in their functionality like the message posting. And we needed to cut off temporarily the evaluation of the market of deciding who is trading with. For keeping the system as simple as possible we had to model the simulation as if it were running in a single country. This helped us a lot for focusing on building the right behavior for our system.
Step 6: assigning modules to team members.
..this was easy :) Marco was assigned to the Market, Ivar started to code the Industry module, and Vigdis was feeding the others with equations and numbers. The “math” work wasn't a real module assignement but it was clearly a very big effort since the numbers and the equations are gathered manually from all over the Internet under supervision of Rognvaldur.
Step 7: starting to code.
We really followed this step literally. We think that it's very important to write modules as shells and nontheless in a breadth-first approach.
The shell style of coding modules means that we built