Putting It All Together

To solve problems with the Flask, one has to map the problem to sets of atoms with binding sites, run the Flask simulator, and analyze the results.  A closer examination of Flask binding site properties will help explain how they are used.

Problems involving rings of atoms can give insight into simple membrane formation.  Consider an attempt to form a ring of atoms as in Figure 1a.  Each A binding site has number 2.  When two free atoms are collided, they will form a molecule as shown in Figure 1b because only one bond is formed from the two binding sites named A.  If one of these modules is collided with a free atom, then a loop of three atoms is formed as in Figure 1c.  If two molecules with two atoms each collide, then a molecule with a loop of four atoms will be formed as in Figure 1d.  No other types of molecules can be formed.


Figure 1 - Binding example.  Atoms in (a) combine to form (b).  The molecule in (b) combines with a free a atom to form (c).  Two
molecules of form (b) combine to form (d).  Not other configurations are possible

Figure 2a and b shows another attempt at forming a loop.  Each atom has an A binding site and a B binding site.  Whenever two atoms are collided, a simple two atom molecule is formed because both A and B bonds are formed.  By changing the binding sites to type onePer (Figure 2c), a simulation will produce longer chains of atoms as shown in Figure 2d and e.  The onePer type applies to atoms, not molecules, so any atom in a molecule can only share one bond with any other atom, but loops can still be formed.  Molecules that are not loops have two free binding sites in three forms:  two A sites, two B sites, or one A and one B site.  If a free atom collides with one of the first two forms, then the line of atoms will be extended by one atom.  If a free atom collides with the third form, the loop is completed.  Because of the stochastic nature of the Flask control mechanism, the Flask will have a number of all the structures early in the simulation.  Since not all collisions will form closed loops, the chains of atoms can grow and form longer loops.


Figure 2 - (a) and (b) illustrate simple binding.  The remaining sub-figures illustrate onePer for forming chains

The nOf attribute is used for a group of binding sites on the same atom.  The number n indicates the maximum number of the nOf binding sites that can form bonds.  One use of this type of binding site is to create a choice in binding.  An atom with 1of  binding sites A, B, and C will only make a bond with one of the three sites in a non-deterministic way.  One must be careful in this version of the Flask that all the nOf binding sites associated with an atom have the same n.

Conditional binding sites are used to activate a new binding site once all the other binding sites have been filled.  One use for this binding site type is to indicate that a molecule has formed a solution to a problem.  For example, consider the arithmetic example from the Introduction.  But, one could add a conditional binding site named Solution to the sum atom.  When the sum atom had attached to two value atoms, the conditional binding site would fire.  One use of this binding site is to link to an atomic machine that outputs the solution to the problem.

AndBond binding sites are typically used in conjunction with conditional binding sites.  An atom can be constructed that looks for molecules that have formed a solution to a problem by attaching only to molecules that have all the binding sites that the atom has and sites for.  If the atom is an atomic machine, then some action can be formed.  In other cases, the atom with the and sites will fire a conditional bond that would bind to an atomic machine.  See the examples in the following sections.

IntraMolecular binding sites will only link to other atoms in the same molecule.  This type of site will not bind to free atoms.  IntraMolecular binding sites are useful when trying to form a structure of bonds in a molecule while preventing attachment to external molecules or free atoms.  The second TSP example in a following section provides an example of the use of this type of binding site.

The  BondLength attribute of a binding site is an arbitrary number that can be used to encode some aspect of a problem onto the Flask model.  One use of this attribute is encoding path lengths as in TSP.  Note that atomic mass can be used to assign a value to an atom, while the bond length is used to assign a value to a binding site and to any bonds formed from the binding site.

To set up a simulation, one must map the real world problem to be solved onto a set of atoms and their binding sites.  By carefully selecting binding sites and providing an adequate number of atoms, a simulation run can then form molecules that represent problem solutions.  An atomic machine can be used to find these solution molecules and output their structure.  One atomic machine in the Flask library will compare the bond lengths of two solution molecules.  The molecule representing the better solution is retained; the other is released or destroyed. 

Running the Flask

There are two ways in which a problem can be defined and run on the Flask.  The first involves using the FlaskRunner GUI application (see Figure 3).  The user of this program defines atoms, binding sites, and events using windows dialogs.  Once the problem is defined, the user can then use FlaskRunner to run the simulation and display results.

The second method is to use the Flask object library to define and run a problem.  This method requires that the user prepare his or her problem by developing a Java program to create atoms and binding sites and calling the Flask object to run a simulation.




Figure 3 - FlaskRunner with pop up MoleViewer window.  Click to enlarge.


The FlaskRunnter has the following features:

  • GUI for constructing, saving, and loading projects
  • Runs simulations while producing an activity graph
  • Molecular views to inspect solution molecules
Figure 4 shows a project being constructed using the FlaskRunner.  Atoms and binding sites can be added and deleted and their properties can be set.



Figure 4 - Defining a Flask project using the FlaskRunner.  Click to enlarge.