-------------------------------------------------------------------- RUNNING BIOLOGO To run BIOLOGO, from this directory: % cd BIOLOGO % ./BIOLOGO BIOLOGO will subsequently run on the specified BIOLOGO file, and then generate new plugins for hamiltonians and automata in the following spot: /src/CompuCell3D/plugins A new config file in: /examples// (The config file will share the same name as the BIOLOGO file, they are both XML files). A new Makefile.am in: /src/CompuCell3D/plugins And finally a new configure.in in: In addition an intermediate file will be generated within the BIOLOGO/ directory, this is only a temporary helper file. CompuCell3D can then be run using these new plugins and new configuration file, after reconfiguration and recompilation. This is done in the normal way from : % ./autogen.sh % ./configure --with-xercesc= % make Note that automake is now going to use the newly generated configure.in and Makefile.am, adding all newly created plugins to the compilation. Also you need in the Makefile within BioLogoReader, to modify the paths for all included libraries accordingly but the Makefile is simple and short, it should be straightforward. -------------------------------------------------------------------- SYNTAX OF BIOLOGO All BIOLOGO files start and end with and tags, respectively. Aside from the hamiltonian and automata declarations, a BIOLOGO file and a CompuCell3D configuration file are no different. That is, all configuration file information that should appear in the configuration file generated by BIOLOGO should be identical in the BIOLOGO file. Example: 10 10000 5 1 This example is from the basic cell sort. This is how this segment should appear in the configuration file, and so this is how it should appear in the BIOLOGO file. The difference is as mentioned, hamiltonians and automata. These are added to CompuCell3D as plugins, by the BIOLOGO compiler. HAMILTONIANS ------------ Hamiltonians are functions that return values of type double. Their template is as follows: .... ... BIOLOGO statements ... A hamiltonian thus has three sections: 1. Input variables 2. Field names 3. Step function (produces an energy deltaE for the Potts Model) 1. Input Variables These are specified as variables that, when this Hamiltonian is referenced as a plugin in XML (that plugin will have the same name as this hamiltonian), these variables should be specified as inputs. Attribute 'name' gives the name of the input, attribute 'type' the datatype, and attribute 'params' (optional) gives a number of cell types to expect as arguments. Right now this can only be 1 or 2. For example, the well known Contact hamiltonian's Input section would look like this: There is also one unique type of Input that should be spoken of. This is the 'file'-'field' relationship. A good example is in the Chemical hamiltonian, for ConcentrationFile: This tells BIOLOGO that an input of ConcentrationFile should be used which accepts a string for a filename, and reads once at the beginning to populate field reactiondiffusion, of type float and dimensions 71x36x211. If you want repeated reads at every given # of timesteps, you can also add a frequency tag: Which says the frequency provided by the user should be measured in timesteps (right now it's the only option). When this plugin is subsequently referenced then in the configuration file, the input will give the filename, and the frequency for reading. An example of this is in dicty. Either of these types of input also creates a field as described below. 2. Field Names These fields are declared as three-dimensional arrays of type with the specified x, y and z dimensions. When referenced in regular expressions, the syntax [x][y][z] is used. These can be referenced within the hamiltonian to which they are declared, and also in any declared automata (that syntax is explained later). 3. Step function This function returns a value of type double for the change in energy assuming this is run at every flip attempt to help determine deltaE. The function is implemented using normal BIOLOGO statements, which are described in the next section. Note, there are also some predefined variables that can be referenced in each hamiltonian: potts.cellfield: a 3D field of type cell. Referenced with the [] operators like a normal field pt: the current selected point for flipping (type pixel) oldcell: the current cell that lies at the selected point (type cell) newcell: the candidate cell that selected point may flip to (type cell) A unique statement that can be used here is . If this statement is reached the expression is returned as the change in this energy. AUTOMATON An automaton, or cell model, can be defined by the following template: ... declare statements ... .... BIOLOGO statements .... .... BIOLOGO statements .... .... BIOLOGO statements .... (Same above template for all celltypes) The first section of the model contains the names of any plugins that can be referenced within this model. If plugin A is specified as included using the tag, all of A's Inputs and Fields could be referenced within this cell model using A. or A.. The following section of the model can contain an unlimited number of BIOLOGO 'declare' statements, each declaring a model variable for all cells in this simulation to possess (these variables can subsequently be referenced in all variables of type 'cell'). The section should be repeated for all celltypes of this model (i.e. the model chickenlimb had 2 celltypes, NonCondensing and Condensing; model dicty had 3, Prespore, Prestalk and Autocycling). A Medium type is automatically declared by default. If the user specifies a Medium celltype in BIOLOGO it is ignored. section contains BIOLOGO statements that should be executed upon the creation of a cell of this type. This also includes the point where a cell transitions to this type. section contains BIOLOGO statements that should be executed at a flip attempt of this cell (unless this cell changes type). section specifies the conditions for a cell to BECOME THIS TYPE. Transitions are attempted for a cell whenever a point inside that cell is chosen for flipping in the Potts Model. If a cell does not change type, the code in is subsequently executed. If a cell does change type, the code in the section of the new cell type is executed. A special statement in this section is the statement: This says that a cell should change type if its current type is and is true. You can have many statements in an section. You cannot use this statement anywhere else. ------------------------------------------------------------------- BIOLOGO Statements (can be used in a Hamiltonian section, sections, sections, or sections: 1. : Use in coordination with one of the following to declare a variable. All variables (with the exception of those predefined) must be declared before use. , Attributes: name(string), value(optional, string) Declare a boolean variable and initialize to , Same attributes, declare an integer , Same attributes, declare a single-precision floating point number , Same attributes, declare a double-precision floating point number , Same attributes, declare a character , Same attributes, declare a string , Same attributes, declare an object of type pixel. You can reference its coordinates using .x, .y and .z , Same attributes, declare a cell object. This cell follows whatever cellmodel was declared and contains whatever variables were declared in this cellmodel. By default all cells contain one member variable, type, of type string - referenced using .type. This will contain one of the celltypes declared in the cellmodel. Sample: 2. , Attributes: to(variable name), from(expression) Copy the value of expression into variable . must be a defined variable (either user-declared or pre-defined). Sample: 3. , Attributes: condition(expression of type boolean) , Attributes: condition(expression of type boolean) , Attributes: none Implements a conditional block. ... BIOLOGO statements ... ... BIOLOGO statements ... ... BIOLOGO statements ... ... BIOLOGO statements ... Execute the BIOLOGO statements within the tag of whichever condition passes first. If all fail, execute the statements within the tags. s and s are optional when using clauses. 4. , Attributes: condition(boolean expression) Executes a set of statements (at least once) while is true. ... BIOLOGO statements ... 5. , Attributes: condition(boolean expression) Executes a set of statements while is true (not at least once). ... BIOLOGO statements ... 6. , Attributes: variable(variable name), from(expression), to(optional, expression), downto(optional, expression), step(expression) <- Note: one of either to or downto is necessary. Counting for loop. Executes a set of statements, starting variable at , going to either or , by a count of . When hits (or ), stop. ... BIOLOGO statements ... 7. , Attributes: variable(variable name of type pixel), point(variable name of type pixel), grid(a three-dimensional field), distance(double), depth(int), checkbounds(boolean) This is a little unique, but useful. At each iteration of this loop, a neighboring pixel within depth to within is calculated and stored in . Distance between and is subsequently stored in . is turned on if CompuCell3D should implement bounds checking on each point it finds. ------------------------------------------------------------------ BIOLOGO Expressions The following symbols can be used: +: Addition -: Subtraction *: Multiplication /: Division %: Mod (: Parenthesis greater: Greater than less: Less than greaterequal: Greater than or equal to lessequal: Less than or equal to equal: Equal to notequal: Not equal to Strings in expressions are surrounded by dollar signs ($). Characters in expressions are surrounded by single quotes ('). In all other ways, expressions can be written in C/C++ notation. In this way several predefined functions of these languages can be referenced (drand48() for example). Questions? Trevor Cickovski tcickovs@nd.edu