Rules of simulations

From Computer Science Wiki
Modeling & Simulation[1]

It's important to define rules that process data appropriately to produce accurate and meaningful results. Here are some key concepts and rules that can be introduced to your students:

  1. Data Integrity Rules: Ensure that the data entered into the simulation is accurate and relevant. This includes rules for data validation (like range checks or format checks) to prevent incorrect data from being used, which could lead to erroneous results.
  2. Transformation Rules: Define how input data is transformed within the simulation. This could be mathematical formulas, algorithms, or logical operations that are applied to the input data to simulate the behavior of the real-world system.
  3. Conditional Rules: Set up conditions under which certain actions occur. For example, in a traffic simulation, you might have a rule like "If the traffic light is red, cars must stop."
  4. Feedback Loops: Incorporate rules for feedback mechanisms where the output of the simulation can influence future inputs. This is particularly important in dynamic systems where the state of the system changes over time.
  5. Conservation Rules: In simulations that involve physical systems, conservation laws (like conservation of energy, mass, or momentum) should be respected to maintain realism.
  6. Boundary Conditions: Define rules for how the simulation handles the edges of the system. For example, in a simulation of gas particles in a box, rules must specify what happens when a particle hits the wall of the box.
  7. Time Progression Rules: Establish how time is handled in the simulation. This includes setting time steps (intervals at which the simulation updates) and determining how time-related changes are applied to the model.
  8. Termination Conditions: Set rules for when the simulation should end. This could be after a certain amount of simulated time, after a specific event occurs, or once a particular condition is met.

Data Integrity Rules[edit]

  • Example 1: In a weather simulation, ensuring temperature data is within a realistic range (e.g., -100 to 150 degrees Fahrenheit) to prevent impossible weather scenarios.
  • Example 2: In a population growth model, verifying that the initial population number is a positive integer, as negative or fractional people are not possible.

Transformation Rules[edit]

  • Example 1: In an economic simulation, applying a formula to calculate GDP based on input factors like labor force, capital, and productivity.
  • Example 2: In a physics simulation, using Newton's second law (Force = mass x acceleration) to determine the movement of an object.

Conditional Rules[edit]

  • Example 1: In a simulation of a school cafeteria, implementing a rule that if the queue length exceeds 30 students, open another serving line.
  • Example 2: In a biology simulation, a rule where a plant's growth rate decreases if the water level falls below a certain threshold.

Feedback Loops[edit]

  • Example 1: In an environmental simulation, higher pollution levels could reduce air quality, which in turn affects public health and subsequently changes the pollution-producing activities.
  • Example 2: In a market simulation, increasing product prices as demand increases, which then affects future demand and production rates.

Conservation Rules[edit]

  • Example 1: In a chemical reaction simulation, ensuring the number of atoms of each element is the same before and after the reaction, adhering to the law of conservation of mass.
  • Example 2: In an energy simulation, making sure that the total energy (kinetic plus potential) in a closed system remains constant over time.

Boundary Conditions[edit]

  • Example 1: In a simulation of a fish tank ecosystem, fish that swim to the edge of the tank are turned around, simulating the tank's walls.
  • Example 2: In a heat transfer simulation, setting the outer edges of a material to a fixed temperature to simulate insulation.

Time Progression Rules[edit]

  • Example 1: In a historical simulation, advancing the simulation by one year each step, applying changes such as population growth or technological advancements.
  • Example 2: In a day/night cycle simulation, updating lighting conditions every simulated hour to reflect the position of the sun.

Termination Conditions[edit]

  • Example 1: Ending a pandemic spread simulation once the number of active cases falls below a certain threshold, indicating control of the outbreak.
  • Example 2: Completing a traffic flow simulation after a simulated 24-hour period to analyze daily traffic patterns.

Please review and play this simulation. What rules are used for this very simple simulation?


Please review and play this simulation. What rules are used for this very simple simulation?


Please review and play this simulation. What rules are used for this very simple simulation.


Please review and play this simulation. What rules are used for this very simple simulation?


Please review and play this simulation. What rules are used for this complex simulation?



  • Describe rules that process data appropriately and that produce results.