The original GitHub issue id is #170.

Context

The initial idea for the optimization framework long ago was to create a modeller for complex optimization systems or complex systems in general, so one could study these. The idea was to take theories and thesis, and to test under which conditions these worked or failed.

The first intention was to model economic systems, to execute such systems given financial data and to test theories based on such executions.

Such a framework was named State Network Execution, Analyzis and Optimization early on. Later it was renamed to State Network Optimization and is now often referred to as Sep (net.splitcels.sep). In its current state it basically connects and coordinates multiple optimization problems with each other, in order to create more complex systems.

Another issue facing the project, was the fact, that there was not one big thing being worked to, but instead there were many little independent features being worked on. Each of them, like the school course scheduling, are interesting, but because of their limited complexity, it is hard to understand, how good the optimization framework would work with really big structures.

So, I searched for a mechanism, where small independent systems could be developed independently, in order to focus on certain features, but which provided a way to merge all such small independents into one big structure.

It occurred, that such structure basically is a world, where on can place and connect things. Games are inherently suitable for this and have the advantage of being advertizable.

Tasks

  • Document goals of this game.
    • Use gamification as a source for motivation.
      • Alternative or counterpart to test recursion: create meaning full tests by combining test problems and thereby creating bigger and more complex problems and test data.
      • The goal is to create optimization algorithm based on reconstruction and deconstruction cycle. This is the reason why the game consists of a reconstruction step, that is basically a city building game, and a deconstruction step, that is basically a war game.
      • Reason why the game is called crisis network: bringing optimization systems to their limits and beyond, in order to learn from it, is a crisis for such optimization system as undesirable states are thereby reached.
  • Create a very simple renderer for it.
  • Provide unsecured local website for testing. -> Not needed. Adjustments to the standard website deployment, create a #client good enough for testing.
  • Create GUI for web server, where one can access and interact with all tables.
    • Create very simple initial HTML renderer for table.
    • Create complete page renderer for table.
    • Add objectsRenderer with an example to website in order to ensure it works.
      • Adjust base path to net/splitcells/cin/instance/testing/.
    • Register renderer to all tables via Dem aspects and object paths.
    • Make it easy to activate this aspect via Dem config.
    • Add project files in src/main/html to path context and make thereby the fullscreen version of renderer discoverable on the website.
    • Provide config for the web server project, where every feature is enabled. This general workflow/app thing would be good in the future for all projects. This could be done via workflow or app classes like the class Dem. -> This is not needed for now.
      • Document this in general Java project guidelines. -> This is not needed for now.
    • Fix layout issue. Otherwise it is hard to find the correct paths via GUI: https://todo.sr.ht/~splitcells-net/net.splitcells.network/108
    • Create dynamic 3D world viewer (currently only Git repo worlds are rendered).
    • Make game usable on Steam Deck.
      • Integrate controller via Web Gamepad API, which makes should make it possible to move the camera through the world.
      • Make it possible to switch between views of 3D world, tables and constraints.
      • Make game easily installable on Steam Deck via Flatpak: #195
    • Clean up GUI and make it usable and somewhat nice.
  • Implement game of life.
    • Run game.
    • Visualize state via file.
    • Make it easy to move camera anywhere in state visualization, in order to traverse big worlds.
    • Implement constraints.
      • Support multiple outgoing groups for one line of incoming group in constraint node.
      • Create timeSteps rater.
        • Make timeSteps without overlapping groups, because this is not supported. Instead, one can use the instances of timeSteps raters, where one represents start times with even values and one represents start times with odd values. This makes the initial implementation easier, because Gel does not support raters with overlapping groups yet.
        • Test time step group content and not just number of groups.
        • Test with random allocations. -> Not needed for now, I hope.
        • Check why linear initialization has non-linear supply and demand selection.
        • During addition and removal, rating events should be calculated by the rater.
      • positionCluster
        • Test negative coordinates.
        • Implement overlapping position groups.
        • Ensure that center position is the groups name.
        • Add constraint to problem.
      • isAlive
        • Implement line removal.
        • Only add cost to center position.
      • loneliness
        • Implement meta data for GroupId.
        • Set cluster position’s center position in meta data.
        • Addition of center position.
        • Create rater base class, that allows a slower but simplified rater implementation. Use this base class for the loneliness implementation. -> This is done via GroupRouter.
      • dies
      • goodCompany
      • survives
      • crowded
      • revivalCondition
      • becomesAlive
    • Check constraints via tests.
    • Visualize state of running instance.
      • Render state at any time.
      • Does not work in Firefox.
    • Check constraints via test run.
      • All GroupdIds should be created based on parent GroupIds, except the root ones. Thereby, creating duplicate GroupId descriptions is avoided.
      • The following is required, but not true: path: [conway-s-game-of-life, Propagation, ForAll, 6, Propagation, ForAll, 0, Propagation, ForAll, isDead, ForAll, .lines, allocations/linesProcessing, linesProcessing, demands-free], line.index(): 0
        • This happens because an allocation is removed multiple times.
        • This is not caused by changing the time step GroupId from no-time-step-group to a time step group.
        • This is maybe caused by PlayerValuePersistenceClassifiers rating update code, where for every line update, all line ratings are updated, regardless, if the rating of already present lines is changing or not.
      • Improve runtime performance, because the calculation of the next state given a current state with about 200 hundred variables takes 2 minutes via the linear initialization. -> It is enough for now to set StaticFlags#ENFORCING_UNIT_CONSISTENCY to false.
      • Require all Raters to have an implementation of toSimpleDescription.
      • Require all Raters based on rater factories to have an explicitly programmed description, in order to always have useful reports.
      • Create solver able to calculate the next state.
      • Improve performance by setting Table.GET_LINE_VIA_STREAM to true.
        • Fix errors caused by this.
      • Add constraint to disallow changes to values, that are not of the next time. There are multiple possible solutions.
        • TemplateAdherence -> Is not relevant for now.
        • CommitmentAdherence
          • Use this as the basis for proposal algorithm inside constraint based repair.
            • Implement proposal API for constraint nodes.
            • Implement IsDead and IsAlive correctly.
              • Implement IsAlive#testAliveWithMultiple.
              • Implement IsAlive like IsDead.
              • Time step determination does not seem to be working.
            • Position clustering does not seem to be working.
              • no-time-step-group should not be propagated by constraint nodes to its children.
            • World#hasGoodCompany does not seem to be working correctly.#
            • World#revivalCondition does not seem to be working correctly.
    • Apply all tests for this only onto complete world instance.
      • Document the reasoning in guidelines for optimization programming.
    • Support problem instances with more than 1 time step in a loop.
    • Update renderer in such a way, that it updates the viewed time to the latest one automatically.
    • There is probably a problem with time steps. -> This is irrelevant by now, because the constraint tree is to be reimplemented.
      • The constraint init seems to be ignored.
      • A error was found: at net.splitcells.gel.data.table.Table.toCSV(Table.java:209)
    • Improve runtime performance, because it the runtime is too extreme.
      • Remove constraint nodes in order to check, what causes the issue. -> This had strangely enough no effect, even though I removed one of the most costly duplicate constraint nodes for the overlapping time steps and position clustering raters.
      • Implement a faster database implementation, which speed up is based on line based value storage, instead of column based value storage, which in turn can avoid copying values, when lines are transferred from one database to a another one. -> The bad runtime performance is cause is dominated by constraints' rating functions. These need to be improved instead.
        • Line based value storage -> LineWithValues
        • Column access values via list of lines shared by database to all of its columns. Therefore, columns are read only.
        • DatabaseTest should test all database implementations.
        • Fix broken Constraint node paths in webserver layout.
        • Improve dynamic lookup performance. See ConstraintAI#registerBeforeRemoval.
        • Speed up LookupTable.
          • Use indexes for value access.
        • Speed up LookupI.
          • Use indexes for value access.
        • Speed up LookupColumn.
          • Use indexes for value access.
      • Speed up constraint nodes by improving free or used demand and supply handling. -> Will be ignored for now, as other performance improvements shows, that the bad runtime is dominated by the concrete constraint tree.
      • Implement faster allocations database for faster constraint nodes. -> This is not needed, because the bulk of slowness is not caused by the slow allocations implementation.
        • Rename Allocations to Assignments.
        • Provide Allocations interface for assignments, where only one assignment per demand and supply is allowed.
        • Provide fast Allocations interface implementation as an alternative to Assignments implementation. -> This not needed for now.
      • Improve lookup via Line#value.
        • Provide faster alternative to Database#add, where the target database header needs to be an exact prefix of the line’s header.
        • Improve performance of Allocations#remove.
        • Improve performance of Allocations#allocate.
      • Ensure, that StaticFlags#logStaticFlags is always executed and printed.
      • Set INLINE_STANDARD_FACTORIES to true. -> Does not have a great effect.
      • Reimplement the constraint of the problem, so that the result creates is faster.
    • Load state from cin log repo.
    • Save state to cin log repo.
  • Make layout of Gel’s game data nice.
  • Create easy to use debug view of state via web server, that is active by default in dev-Config. -> The standard layout view http://localhost:8448/net/splitcells/website/layout.html is good enough.
    • Cin.configure(env);
    • This is provided via GelDev#process and the port 8448 is used for this by default.
    • Fix layout refresh error.
    • Create tree view of layout.
  • Implement game of life with 2 players.
  • Implement game of life with 2 players, where each player has choices and wants to maximize its liveness.
  • Find a name: crisis network = cin
    • Document reasoning for name.
  • Run the game on public server for people to watch. This also helps to make the software deployable in general.
  • Serve all JavaScript dependencies locally.
  • Make it easy to execute software in IDE with ENFORCING_UNIT_CONSISTENCY_KEY set to false, in order to have reasonable runtime performance.
  • Make web server for debugging more mature. Currently, it takes a long time to start and the code is an hack.
  • Write article explaining and demonstrating this.

Ideas For Future Tickets

  • Create constraint renderer.
  • Create constraint editor.
  • Create table editor.
  • Create automatic game instance reporter for local execution and social media advertisement.
  • Large moving entities with large and diverse capabilities and with supply chain requirements (i.e. something like vehicles, aircraft or aircraft carrier).
  • Make this a blockchain game and thereby trigger people.
  • Run public server.
    • Create service infrastructure in order to run webserver in the background via a nice and sustainable API.
  • Create a world presenter.
  • Visualize optimization and table network overview.