June 28th

Over the last few days I’ve been working on two new issues. The first is a new set of pages presenting background information on technology. I realized that it’s important to provide some explanation of the underlying technologies, even if these are not in any way variable. For example, how does a thermal power plant work? What’s a turbine? What’s fission? These and many other issues must be addressed. So far, I have added pages explaining breeder reactors, the accident at Chernobyl, steam condensers, how nuclear reactions are controlled, fusion energy, fission reactor technologies, hyperbolic cooling towers, nuclear reactions, nuclear safety, organic solar photovoltaic technology, pigovian taxes, rad waste disposal, solar photovoltaic technology, spent fuel pools, thermal power plants, turbines, and the accident at Fukushima. I started with nuclear power technology because I have most of that in my head; other stuff will take more time because of the requirements to research the material. 


I have implemented these as non-interactive pages in the system. You don’t get to control anything, and there are no numerical values associated with the pages. They’re just explanations; it’s all done with standard hyperlinks. However, this caused me a major headache. Hyperlinks can readily be displayed and executed in JTextPanes, but I can’t include them in my XML document. My plan was to have one big XML document that would include all the information on each page, including its text. However, if I embed the HTML inside the XML, then the XML reader software blows up; it doesn’t like HTML inside its nice neat XML categories. I’m sure that, with suitable effort, I could figure it out, but it seems too much work at this point. One reason for this is because the XML document includes only factors that count in the simulation — that is, things that are calculated. These other pages aren’t factors. By keeping HTML separate from the XML, I don’t have to worry about the difference. However, I do have a bit of a mess in that there’s a big folder with about a hundred documents inside, one for each page. I suppose that it’s acceptable; I worry, though, that as the simulation expands, it will become too messy to edit cleanly.

I considered some way of faking the HTML; after all, the only things I want to handle are the HTML bold, italic, and link tags. I considered creating my own “fake HTML”, in which I use my own custom delimiters to specify these elements, and the code that reads the XML files converts my fake HTML tags into actual HTML tags. However, this seems a bit clumsy and there’s still the problem of all the non-factor pages. So for now, I’ll live with the current system.

The other big project is getting all the formulae in place inside the code. I had wanted to have the formulae included in the XML document, with a parser that reads the formula text and calculates the result, but in the end, I decided that this would take too much time. All in all, better to have separate code and text representing it. I just have to make sure that all those pieces are in harmony with each other — another bit of busywork.

I’m about halfway done putting in the formulae. Once that’s done, then I start running the simulation. I fully expect it to blow up in my face and require at least a week to get running decently. Then will begin all the quibbles and adjustments.