001 package com.croftsoft.core.sim;
002
003 /***********************************************************************
004 * A simulation object updated in separate access and mutate phases.
005 *
006 * Each loop of the simulation is started with an access (read) phase and
007 * then followed by a mutate (write) phase.
008 * During the access phase, simulation objects access the state of other
009 * simulation objects to determine how their state will change during the
010 * mutate phase. The state of simulation objects does not change during
011 * the access phase.
012 * During the mutate phase, the simulation objects change state. The
013 * state of simulation objects is not accessed by other simulation
014 * objects during the mutate phase.
015 * Dividing the state update into two phases ensures that the result of
016 * the update is not dependent on the order in which the simulation
017 * objects are updated. For this to hold, the access method of every
018 * simulation object must be called at the beginning of the simulation
019 * loop before the mutate method is called on any one of the simulation
020 * objects.
021 *
022 * @version
023 * $Id: Sim.java,v 1.1 2008/07/25 22:54:58 croft Exp $
024 * @since
025 * 2008-07-25
026 * @author
027 * <a href="http://www.CroftSoft.com/">David Wallace Croft</a>
028 ***********************************************************************/
029
030 public interface Sim
031 ////////////////////////////////////////////////////////////////////////
032 ////////////////////////////////////////////////////////////////////////
033 {
034
035 void access ( );
036
037 void mutate ( );
038
039 ////////////////////////////////////////////////////////////////////////
040 ////////////////////////////////////////////////////////////////////////
041 }