To create your own model with rules, follow these steps:

1) First, download and install windows application.

2) Get the sources, then add new class file with name of the model to the CA.SampleTestableModels project. Implement the ITestableModel interface.

3) Create main functionality inside the Test method. Remember, that you can change state only of the current particle, when going through all of the cells inside loops. Keeping this rule will save your time when investigating issue with your new model.

4) Inside the Test method, it needs to provide calculations, save state of the particles and draw the result on the SdlScreenPixelBuffer surface using colors from the 'colors' palette.
Information about state of each cell is stored in the one one-dimensional array of integer values (type of short). One-dimensional array is a simplification of the two dimensional. Keep in mind that all matrices are two dimensional, and storing information in that way is just a simplification, to speed up the data processing.

5) The "iterationsCount" parameter specifies how many iterations it needs to perform without providing intermediate result of the calculations. It is useful when user wants to get system state after some long period of time and he is not very interested in the intermediate calculations.

6) When development of a model is completed, it needs to copy the library into the 'Modules' folder of the application folder. Usually it is "c:\Program Files (x86)\SamQQQ\Cellular Automates Emulator\Modules". Model will be automatically loaded, and new rules should be available in the rules set select box.

Last edited Aug 27, 2013 at 5:39 AM by SemShekhovtsov, version 6

Comments

No comments yet.