############################################ #### SMN v4.0 Game of Life (beta) #### ############################################ #### John Ringland 2006/01/25 #### #### www.Anandavala.info #### ############################################ -- modified 2006-02-01 restructuring of the code -- modified 2006-02-06 restructuring of the code This program should run on all DOS or Windows based systems (linux versions will be released when I am able). The latest version can be found via: www.anandavala.info/TASTMOTNOR/code/v4.0/SMNGL4_1.html SMN is a new system modeling methodology that allows for the realistic simulation of general systems. See: www.anandavala.info/TASTMOTNOR/SMN%20Comments.html This program is a simple illustration of the core functionality of SMN. This example creates a "Game of Life" scenario where every cell's new state depends on it's nearest neighbour's states according to the following rules: A cell will continue to live if it has two or three neighbors and it will die otherwise. If an empty cell has three live neighbors, a cell will be born. These types of dynamic canvases could be implemented using traditional methods, which would be more efficient in these particular scenarios but it would have far less flexibility. In this SMN scenario each pixel is a unique individual which could, if one wished, be programmed with its own unique behaviour and it would then perceive, experience and respond to its environment in its own unique way. This program is presented purely as a proof-of-concept for the underlying mathematical methodology. The "Particle Simulator" example illustrated SMN's functionality for small numbers of maximally interacting systems where every particle interacts with every other particle (full matrices, full processing). The Dynamic Drawing example illustrated the case of large numbers of sparsely interacting systems with extensive activity (sparse matrices, full processing). And this example illustrates large numbers of sparsely interacting systems with minimal activity (sparse matrices, energy flow processing). Note: a 100x100 canvas contains 10,000 individual systems and each system interacts only with its nearest neighbours within a 2D metric space. The regions of activity are generally localised with populations of cells being born and dying thus creating evolving patterns of localised activity. For more information on this program and modeling paradigm see: www.Anandavala.info/TASTMOTNOR/code/v3.2b/SMNGL4_1.html Please send any bug reports to john.ringland[AT]anandavala.info with the words "bug report v4.1" somewhere in the subject. This would be much appreciated and will help me improve the program over time. Any other comments or suggestions are also welcomed. --------- Contents: --------- The Program: The Simulated System: Interacting with the Simulation: Model Parameters: Trouble Shooting: ------------ The Program: ------------ Unzip the folder then run "life.bat". In Windows: If you wish to place an icon on your desktop right click and drag the file "life.bat" onto your desktop and then from the menu choose to create a shortcut. In some windows environments you may need to execute the program from a full screen dos prompt in order for the dos graphics routines to work. This is only a very simple example of some of the core functionality of SMN, but SMN allows for many advanced features which are unique to SMN. Many of these features are not implemented yet, but later versions will be out soon with more features and fututre versions will become gradually more general, flexible and will exhibit advanced system analysis and simulation features. --------------------- The Simulated System: --------------------- The system consists of a series of cells organised into a 2D space. One can interact with these and thereby create patterns that dynamically evolve. The simulation is not meant to be a full featured program, it is just a simple illustration of the core simulation capacities of the SMN modeling paradigm. It's other capabilities will be illustrated eventually. The system model is defined in the file "smModels.ex" which is itself written in the programming language "Euphoria" (www.rapideuphoria.com). -------------------------------- Interacting with the Simulation: -------------------------------- When the simulation runs there is a dynamic canvas displayed on the screen. * \'p\' = toggle Pause on and off, whilst paused one can still edit the model * \'s\' = Step forward one frame at a time, press 'p' to resume * \'c\' = change colours * \'z\' = Zoom (change magnification) * \'r\' = Reload current model (Restore model) * \'m\' = load or save Model * \'i\' = load or save Image * \'h\' or \'?\' = quick Help screen * any other key = show main menu * use the left mouse button to draw with the chosen drawing colour * use the right mouse button to draw with the background colour (erase) * it is easiest to edit the canvas whilst the simulation is paused The rest of the interface should be self explanatory. ----------------- Model Parameters: ----------------- The underlying system model is stored as a model file (*.L41) in the "Models" directory. One can also save bitmaps into the "Images" directory and if required a corresponding model file will be created in the "Models" directory. You can also create a new canvas from an option in the edit model menu. When creating a new canvas from the edit model menu (for a large canvas this can take some time), it is advisable to then save it as a model file ready to be loaded and drawn on. Using the "load image" option one can load up arbitrary images and see how they evolve but they must be accompanied by an appropriate model file. The model file must define a canvas with the exact dimensions of the image and be named in the form "B###x###.L41", e.g. "b080x040.L41" for an 80x40 image. The bitmap image must be a 4 bit (16 colour) image drawn in black and white. It is generally advisable that the model uses sparseSm and energy flow processing when used with an arbitrary image. There are some example images in the "Images" directory to play with. Changing Computational Method: ------------------------------ see: www.anandavala.info/TASTMOTNOR/Finite%20Discrete%20Information%20Systems.html#software_implementation Sparse Matrices: ---------------- From the edit model menu one can change the underlying matrix type from full representation to sparse represntation. A full matrix represents all elements whereas a sparse matrix represents only the NON-ZERO elements. In this particular scenario each pixel interacts only with neighbouring pixels so there IS efficiency gained by using sparse matrices. A large drawing canvas may cause your computer to run out of memory otherwise. Most engineering scenarios have this sparse connectivity so sparse matrices can lead to significant efficiency gains in those cases. Energy Flow Processing: ----------------------- With full processing every causal interaction pathway is computed in every moment whereas with energy flow processing only those pathways that are communicating new information are computed, so if nothing is happening (no energy flow) then nothing need be computed. This particular scenario exhibits some of the benefits and drawbacks of energy flow processing. When there is only a very small region of activity then energy flow processing will lead to faster processing but it will slow down when the canvas becomes full of activity. In many engineering scenarios there is a large space of potential activity (e.g. blank canvas) but only a small region of actual activity so energy flow processing can lead to significant efficiency gains in those cases. With full processing the computational load is constant and depends only on the size of the canvas, not on what is happening on the canvas. One can dynamically switch between these methods as the activity level changes. ----------------- Trouble Shooting: ----------------- If you have a problem, let me know and I will attempt to resolve it. Here I'll build a list of known problems and ways around them. ---------------- There are many enhancements in progress and these will be released as they are ready. The next major release will probably utilise the general principles illustrated in this example but develop them for arbitrary systems, not just systems of particles. Then I will construct a simple piece of software using SMN and people may explore it as a system model. This game of life scenario is also ideal for exploring the state space analysis methods that allow one to systematically explore the space of all forms that may arise within that space. One could systemtically catalogue all possible objects and their relations.