예제 #1
0
 public MainPanelController(GrowthSimulation v,  Habitat env)
 {
     view = v;
     environment = env;
     environment.AddNewBindingListener(new BindingListener(view));
     view.AddCloseListener(new CloseListener(env));
     view.StatusMessage("Started");
 }
예제 #2
0
        static void Main(string[] args)
        {
            Crystals.Habitat environment = new Crystals.Habitat(150, 10, 0.01, 150, 150, 1, Molecule.RADIUS);

            environment.ThreadStart();

            //3.14*80*80*0.01
        }
예제 #3
0
        public void SetUp()
        {
            habitat = new Habitat(1, 1, 1, 150, 150, 1, 2*Molecule.RADIUS);

            mZero = new Molecule(habitat);
            mZero.Position.X = 0;
            mZero.Position.Y = 0;
            mZero.AttachedIteration = 0;
            mZero.BoundType = BoundType.I;
        }
예제 #4
0
        static void Main()
        {
            double radius = 200, temperature = 10, density = 0.01;
            float scale = (float)0.5;
            double Desire = 1;
            double DesireRadius = Molecule.RADIUS * 10;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            growthSimulation = new GrowthSimulation((int)radius, scale);
            env = new Habitat(radius, temperature, density, growthSimulation.Center.X, growthSimulation.Center.Y, Desire, DesireRadius);
            densityBarController = new DensityBarController(growthSimulation, env);
            densityBarController.BindListeners();
            speedBarController = new SpeedBarController(growthSimulation, env);
            speedBarController.BindListeners();
            mainPanelController = new MainPanelController(growthSimulation, env);

            env.ThreadStart();

            Application.Run(growthSimulation);
        }
예제 #5
0
 public Molecule(Habitat habitat, InitMoleculeType type)
 {
     Init(habitat, type);
 }
예제 #6
0
 public Molecule(Habitat habitat)
 {
     Init(habitat, InitMoleculeType.Initial);
 }
예제 #7
0
 public void Init(Habitat habitat, InitMoleculeType type)
 {
     this.habitat = habitat;
     if (type == InitMoleculeType.Center)
     {
         Position = new Position(0, 0, new V(0, 0), this);
         AttachedIteration = 0;
     }
     else
     {
         Position = Position.NextRandomPosition(
             habitat.CondensationCenter.Position.X,
             habitat.CondensationCenter.Position.Y,
             habitat.Radius,
             this.DefaultSpeed,
             this,
             type == InitMoleculeType.Additional);
     }
 }
예제 #8
0
 public CloseListener(Habitat env)
 {
     habitat = env;
 }
예제 #9
0
 public ParametersChangedListener(Habitat env)
 {
     habitat = env;
 }
예제 #10
0
 public DensityListener(Habitat env)
 {
     environment = env;
 }
예제 #11
0
 public DensityBarController(GrowthSimulation v, Habitat env)
 {
     view = v;
     environment = env;
 }
예제 #12
0
 public HabitatPresenter(Habitat habitat)
 {
     Habitat = habitat;
 }
예제 #13
0
 public MoleculeAddListener(Habitat habitat)
 {
     this.habitat = habitat;
 }
예제 #14
0
 public SpeedListener(Habitat env)
 {
     environment = env;
 }