Firefly Synchronization Simulation萤火虫发光同步模拟实验报告

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。



5. Evaluation
5.1 experiment results
Experiment 1: GridSize CycleLength FiringThreshold TimeSteps 10 6 5 2 10 6 3 2 10 6 4 2 10 6 3 2 10 6 17 3 10 6 21 3 10 6 15 3 10 6 22 3 10 6 27 4 10 6 35 4 10 6 30 4 10 6 28 4 Results above shows (with the value of cycle length and firing threshold unchanged):
3
The larger the grid size is, the more time steps would be taken to achieve the synchronization. Experiment 2: GridSize CycleLength FiringThreshold TimeSteps 4 3 1 3 4 3 8 3 4 3 4 3 4 3 9 3 7 3 17 3 7 3 10 3 7 3 12 3 7 3 12 3 10 3 16 3 10 3 14 3 10 3 23 3 10 3 26 3 Results above shows (with the value of grid size and firing threshold unchanged): The larger the cycle length is, the more time steps would be taken to achieve the synchronization. Experiment 3: GridSize CycleLength FiringThreshold TimeSteps 12 3 31 3 12 3 42 3 12 3 37 3 12 3 44 3 12 6 38 3 12 6 35 3 12 6 25 3 12 6 30 3 12 9 29 3 12 9 36 3 12 9 29 3 12 9 38 3 Results above shows (with the value of cycle length and grid size unchanged): The larger the firing threshold is, the fewer time steps would be taken to achieve the synchronization.
ID: 1290750 Introduction to Natural Computation Coursework
Firefly Synchronization Simulation
1. Introduction - aim/motivation
Implement a cellular automata simulation of firefly synchronization. The aim is to discover under what conditions synchronization occurs and how fast the synchronization can be.
4.2 Experiment design
Experiment 1: discover how the value of grid size may affect the synchronization Change the value of grid size with the value of cycle length and firing threshold unchanged. Experiment 2: discover how the value of cycle length may affect the synchronization Change the value of cycle length with the value of grid size and firing threshold unchanged. Experiment 3: discover how the value of firing threshold may affect the synchronization Change the value of firing threshold with the value of cycle length and grid size unchanged.
5.2 Surprising findings
Even when the value of grid size, cycle length and firing threshold stay unchanged, the time steps taken to achieve synchronization vary at a relatively large scale.
2. Background - firefly synchronization phenomenon
The behavior of one firefly is as follows:
In this model, the sensitive (charging) period takes 7 units of time and a cycle is composed of 10 units of time. Considering that the first time step of a cycle is 0, a firefly achieves the threshold level at the time step 6 of the cycle. The flashing occurs after 3 units of time from the threshold level, meaning that a firefly flashes at the time step 9 of a cycle. If a firefly is in its sensitive period when a neighbor firefly flashes, it is reset to the time step 0 of its cycle. However, if a firefly is in the non-sensitive period, it keeps its behavior as if nothing happened.
3.3High-level structure of program(detailed code seen in appendix):
public class Firefly2D { // Main function to simulate the synchronization public static void simpleFireflies(int sizeGrid, int cycleLength, int firingThreshold, int numTimeSteps) { <code> } // Print flash with ”*” if it's flashing time public static void printFirefliesFlash(int[][] fireflies, int cycleLength) { <code> } // Update the state if firefly is within firing threshold and its neighbor is flashing public static int[][] updateFirefliesState(int[][] fireflies,int cycleLength, int firingThreshold) { <code> } // Judge if the neighbor is flashing public static boolean neighborIsFlashing(int[][] fireflies, int i, int j,int cycleLength) { <code> } // Main method public static void main(String[] args) { // inputs for running firefly algorithm int gridSize = 2; int cycleLength = 10; int firingThreshold = 6; int numTimeSteps = 10; // call our main method here by passing on the 4 inputs simpleFireflies(gridSize, cycleLength, firingThreshold, numTimeSteps); } }
Leabharlann Baidu
3. Project Specification
1
3.1Programming language:
JAVA
3.2 Implementation method:
Use two-dimension array (int[][] fireflies) to represent the population of fireflies, which can store the current and updated state of each cell.
6. Summary
6.1 Aim of study
Discover under what conditions synchronization occurs and how fast the synchronization can be.
6.2 Key design choices
4

It seems that how fast the synchronization can be achieved has a relationship with how many flashing fireflies exist in the initial 2-D array. The more flashing fireflies exist in the initial array, the faster synchronization can be achieved.
4. Experiments Plan - problem analysis & solution design
2
4.1Parameters:
Grid size: number of fireflies (e.g. 10 fireflies) Cycle length: value range that fireflies can have (e.g. if length = 10, value increases from 0 to 9; when value = 9, the firefly flashes.) Firing threshold: the value to decide whether to reset the current status. (e.g. if threshold = 6, reset firefly when its neighbor is flashing and its status value <= 6) Time step: how many iterations we want firefly to synchronize (e.g. 200) to stop our program.
相关文档
最新文档