Posts by crispy1989

    For MOX designs, you just "blacklist" reactor hull heat transfer.

    The way these types of algorithms work, they "figure out" what needs to occur to get to the end goal (which is an efficient reactor that doesn't explode), instead of being programmed with intermediate goals (such as trying to balance heat transfer). This allows them to approach problems (insofar as random mutations are an approach) in ways that a human may have not even considered.

    What happens if you start it off with some human-created designs already known to work well, instead of whatever random mish-mash it generates randomly? Would is be able to find improvements that have slipped our engineers' brains?

    Yes and no. The final phase of the genetic algorithm (the "promoted" population) is essentially an annealing/fine-tuning phase, where it only makes minor tweaks to make small optimizations, without changing the overall design. This could be applied to human-generated designs to make minor improvements. However, *only* minor improvements would result. Human-generated designs would lack genetic variability, which is key to the correct function of genetic algorithms. In DNA terms, human-generated designs lack introns.


    I'd be interested in having a contest between this genetic algorithm and a human designer. Specify a set of exact requirements on which designs are evaluated, pick the current best human-generated design, and see if the genetic algorithm can find a better design - without any help or pre-seeding from the human design. It's quite possible that this could outperform the human design process, making pre-seeding it with a human-generated design completely unnecessary.

    Also, I see that a few of the designs on that page look kind of intelligently built, rather than a bunch of random components that happens to not explode.

    Only the very first generation is random components thrown together. Complex patterns arising in the result doesn't imply intelligent design - just as the complex arrangement of molecules and cells in animals doesn't.


    And, a final suggestion: Make it work with MOX by having it really like designs that do not heat up or cool down over time while running, and like designs that don't cool when turned off either even more. Heat dumped into hull equalling that pulled out by vents and things is good; the smaller those rates are, the better.

    I haven't coded in support for MOX fuel cells yet. I may add support if there's enough interest, but the result would likely take longer to stabilize, as exact equilibrium is harder to achieve using annealing-style techniques. Also, if I do add support for MOX cells, it wouldn't rate reactors based on the equilibrium being achieved - it would rate designs based on the same basic factors, eu produced, cycle time, efficiency, etc. The nature of the algorithm is that many different approaches can achieve the same result. Consider the case of a reactor that (somehow?) produces a sinusoidal wave of heat. While not in equilibrium, such a reactor could potentially have better overall results.

    As a software developer, I like to try to automate as much as possible. Addons like IC2 and Buildcraft are great for this - but there are still some manual processes involved, such as actually designing the nuclear reactor. So I figured, why not write a program to automatically design an optimal reactor for me?


    The result is a two-part application - an ultra-fast simulator that can analyze a reactor design in milliseconds, and a genetic algorithm controller to control the optimization process. The genetic algorithm can be configured to optimize for any type of reactor based on simulation results. You can see the current status of the ongoing simulation here:


    http://www.silentkitty.net/share/temp/reactor/test/


    Currently, it is optimizing for an efficient mark I reactor that does not utilize consumables (reflectors or condensators), then optimizing for EU/t output, then for component cost. It's an intensive algorithm, so it's not likely to stabilize on a great result for several days. If anyone has suggestions for other types of designs to optimize for, let me know, and I can reconfigure the algorithm.


    Essentially this works by treating reactor designs as DNA, and applying Darwinian evolution (ie, natural selection). It starts out with several completely random reactor designs (just a random mish-mash of components across the board), and tweaks it based on making many different types of random mutations. Poor performers die off, while the better performers survive to produce offspring. Additionally, two different designs can mate with each other to produce a hybrid, increasing the genetic diversity.


    Note that the designs produced by this simulator may not perform identically in existing reactor simulators. The code for the simulator used here is based on reverse engineering the decompiled code from IC2. In general, this simulator will produce more accurate results. The only way to know for sure is to actually try the design in-game.


    Note that the version of IC2 the simulator is based on is IC2 2_2.0.397-EXPERIMENTAL


    There's a lot more involved in actually getting this to be an effective designer. Anyone interested can look at the code:
    For the simulator (C++ for speed): https://github.com/crispy1989/node-ic2-reactor-sim
    For the genetic algorithm (Node.JS for configurability): https://github.com/crispy1989/ic2-genetic-reactors


    Simulator and genetic algorithm are by myself, crispy1989. The web UI is by clueless222 aka cluekitty.


    Feedback is welcome! In particular, if you have particular design requirements that you'd like to optimize for, just post them here. Things that can be optimized for (including in combination with each other) include: Efficiency, EU/t, mark level, overall EU/t (for Mark II+, the average EU/t including cooldown time), whether or not reflectors are used, whether or not condensators are used, component cost, and more. Since simulations are long-running and can take several days, I'll periodically select a popular request to run, and will post here when a new run has started.