Chaotic Motion  1.0
ChaosEqnFactory.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 public class ChaosEqnFactory {
6 
7  // Add any new chaotic equations to this list
8  private static System.Type[] eqnClasses =
9  {
10  typeof(Aizawa),
11  typeof(Anishchenko_Astakhov),
12  typeof(Arneodo),
13  // typeof(Bouali2), need to find stable params
14  typeof(Chen),
15  typeof(ChenLee),
16  // typeof(DequanLee), // needs tuning
17  typeof(GenesioTesi),
18  typeof(Hadley),
19  typeof(Halvorsen),
20  // typeof(LiuChen), // needs more research
21  typeof(Lorenz),
22  // typeof(LorenzNew), // Needs param tuning
23  typeof(LuChenCheng),
24  typeof(LuChen_Transition),
25  typeof(NoseHoover),
26  typeof(Rossler),
27  typeof(Rucklidge),
28  typeof(ShimizuMorioka),
29  typeof(SprottB),
30  typeof(SprottC),
31  typeof(SprottD),
32  typeof(SprottE),
33  typeof(SprottF),
34  typeof(SprottG),
35  typeof(SprottH),
36  typeof(SprottI),
37  typeof(SprottJ),
38  typeof(SprottK),
39  typeof(SprottL),
40  typeof(SprottM),
41  typeof(SprottN),
42  typeof(SprottO),
43  typeof(SprottP),
44  typeof(SprottQ),
45  typeof(SprottR),
46  typeof(SprottS),
47  typeof(Thomas),
48  };
49 
50  private static List<ChaosEqn> eqnList;
51 
57  public static List<ChaosEqn> GetEquations() {
58 
59  if (eqnList == null) {
60  eqnList = new List<ChaosEqn>();
61  for (int i=0; i < eqnClasses.Length; i++) {
62  eqnList.Add( Create(i, 0, null) );
63  }
64  }
65  return eqnList;
66  }
67 
73  public static ChaosEqn Create(int index, int paramIndex, ParamBundle customParams) {
74 
75  ChaosEqn chaosEqn = System.Activator.CreateInstance(eqnClasses[index]) as ChaosEqn;
76  ParamBundle[] paramBundles = chaosEqn.GetParamBundles();
77  if (paramIndex < paramBundles.Length) {
78  chaosEqn.paramBundle = paramBundles[paramIndex];
79  } else {
80  chaosEqn.paramBundle = customParams;
81  }
82  chaosEqn.SetParams(chaosEqn.paramBundle);
83  return chaosEqn;
84  }
85 }
ParamBundle paramBundle
The parameter bundle that is used to evolve the system.
Definition: ChaosEqn.cs:19
static ChaosEqn Create(int index, int paramIndex, ParamBundle customParams)
Create the ChaosEqn implementation for the specified index in the eqnList, with the selected param bu...
Definition: Thomas.cs:6
Definition: Lorenz.cs:6
Definition: Hadley.cs:5
abstract void SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
Chaos eqn. Base class for all equations that define a 3D chaotic system.
Definition: ChaosEqn.cs:9
static List< ChaosEqn > GetEquations()
Returns a List of Equation objects. A singleton reference list is provided for the inspector script t...
Definition: Chen.cs:5
ParamBundle[] GetParamBundles()
Gets the parameter bundles defned for the chaos equation.
Definition: ChaosEqn.cs:25
Definition: Aizawa.cs:7
Parameter bundle. Container class to hold the values for starting a chaotic system. Holds the parameters for the equations and the initial position and scale values.
Definition: ParamBundle.cs:13