MatrixTranslator

From VLE

Jump to: navigation, search

The translator of grid (matrix) of DEVS models (not necessary CellDevs model) :

 <?xml version="1.0" ?>
 <celldevs>
  <grid>
   <dim axe="0" number="11" />
   <dim axe="1" number="7" />
  </grid>
  <cells connectivity="neuman|moore" library="libcellule" >
   <libraries>
     <library index="1" name="lib1" />
     <library index="2" name="lib2" />
   </libraries>
   <prefix>cell</prefix>
   <init>
 0 0 0 1 1 1 1 1 1 1 0
 0 0 0 0 1 1 1 1 1 1 0
 0 0 0 0 0 1 1 1 1 0 0
 0 0 0 0 0 0 1 1 0 0 0
 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0
   <!-- 1: cell is present, 0: no cell. Matrix line by line
           from 0,0 (top left) to 11,6 (bottom right). -->
   </init>
  </cells>
 </celldevs>

The init part is optional. If it isn't presented then the same library is used for all cell of matrix.

There are two possible specifications of the library:

  • using an attribute in the tag cells: a single library is possible
  • using block libraries: many libraries are used in the matrix denoted init

The names of port are the following:

  • moore (4 neighbors): N, E, S et W
  • von neumann (8 neighbors): N, NE, E, SE, S, SW, W et NW

These input ports are utsed by CellDevs for exchange of cell states.

Warning, important naming rule : The names of the cells start at 1. The first cell of a cellular automaton is (1, 1) if the automaton is in two dimensions.

This page was last modified on 4 July 2010, at 15:36. This page has been accessed 799 times.