Spatial Atoms

Atoms in the Flask have virtual location by default.   Atoms that extend the SpatialAtom class or implement the SpatialAtomInterface have (x, y, z) coordinates in an integral coordinate system.  In the current version of the Flask, there is no method to implement spatial atom motion.  With a slight modification to the Flask, such motion could be implemented.  But, even with this limitation, some spatial problems can be solved.

Membrane Formation

Membrane formation in nature is an interesting mechanism.  Very simple membrane experiments can be simulated using the Flask.  In the Putting It All Together section, the formation of cycles using virtual location atoms is discussed.   Such experiments illustrate simple, 2D attempts to form membrane-like structures with bonds forming the edges of the membrame.  Due to the stochastic nature of the Flask and the way binding sites work, it is challenging to form cycles of arbitrary length easily.  There are several obvious approaches


  • Create two types of atoms:  ones that form chains and ones that close a chain to form a cycle, and set the relative concentrations of the cycle closing atoms to be much smaller than the chain atoms.
  • Set up the problem as above, but replace the cycle forming atom with an atomic machine. The atomic machine could test the length of the chain and only form a cycle if the length of the chain exceeds a predetermined length
City Growing Problem

The city growing problem illustrates problem solving using a grid of spatial atoms.  In this problem, there is a 2-dimensional grid, 10 X 10, with three randomly placed cities.  The solution to this problem is an association between the open grid squares and the cities, such that there are two medium cites, each holding 21 squares, and one large city holding 44 squares.

The Flask solution to this problem is experimental and will only be sketched here.  To set up the problem, a 10 X 10 grid of spatial atoms are constructed programmatically.  Each atom has 8 spatial A binding sites that represent attachments to the 8 compass directions.   Because all the binding sites are spatial, only adjacent atoms can form bonds.

If the grid is run in the Flask, bonds form and the cities "grow" in area.  Eventually, all of the atoms will be bound into three molecules, each associated with a particular city.  There are some special Flask parameters that help city structures to form quickly.
  • Seed Atoms - The city atoms are declared as seed atoms, and a probability is given that indicates how often seed atoms are selected when selecting atoms for collisions.
  • Favor Adjacent - There is a Flask parameter that indicates how often adjacent atoms are selected for collisions. This parameter can be used to speed up activity by selecting atoms that will likely produce productive collisions in a spatial problem.
  • Form Structure - This parameter affects how binding occurs when a spatial atom binds to a molecule.  The parameter causes the Flask to form all available adjacent bonds between the atom and the molecule.
  • Break Frag - This parameter deals with how molecules are affected when heat is applied to the Flask.  If it is enabled, heat will not dissolve molecules that contain a seed atom.
There is one virtual location atomic machine used to solve this problem.  The CityMachine atom monitors the progress of the atomic structure and perturbs solutions that are stuck. The atomic machine is run at the end of every iteration.  It examines the solution so far, and signals the Flask with a photon if a solution has been found.

If no solution has been found, the machine looks at the number of collisions that resulted in bonds being formed during the last iteration of the simulation.  If no new bonds were formed, the CityMachine decides how to perturbate the current solution based on how close the solution matches the city size criteria and how many times it's been perturbated before.  If a small adjustment should be made, the atomic machine generates heat to perturbate the city structure around the perimeter of the city molecules.  The heat breaks the bonds of some atoms that are adjacent to atoms in another city.  When the simulation continues, these newly created free atoms might bond back to the same city, or they might bond to a new city.  Different temperatures are applied depending on the goodness of the solution, with higher temperatures creating more free atoms.

If the solution is stuck, the CityMachine sends a high energy gamma ray to break all the bonds, and a new attempt is made to find a solution.  This process continues until a solution is found or the user-selected maximum number of iterations are exceeded.

Unlike many search methods, this approach to the city problem is not guaranteed to find a solution if one exists.   More work needs to be done to make this solution method better. Currently, this problem cannot be set up in the FlaskRunner GUI; however, a stand-alone visualization system has been written.  Figure 1 shows one Flask-generated solution to the city problem. 


Figure 1 - Flask solution to the city growth problem after 72 iterations.