-
Notifications
You must be signed in to change notification settings - Fork 1
Experiment Manager
Samuel Knox edited this page Jan 6, 2021
·
6 revisions
The Experiment Manager is a tool that can be used with any script and will change independent variables and record dependent variables.
- Add the experiment manager script to any gameObject
- Select the target script with independent and dependent variables
- Select variables from drop-down menus and method of data collection
- Set the final variables
You MUST have a ResetExperiment
which takes Dict<string, float>
as the sole argument in your target script. An example is below:
public void ResetExperiment(Dictionary<string, float> dict)
{
// Set variables - CRUCIAL
foreach (var kvp in dict)
{
GetType().GetField(kvp.Key).SetValue(this, kvp.Value);
}
// Destroy agents
var agents = GameObject.FindGameObjectsWithTag("UAV");
foreach (var agent in agents)
{
DestroyImmediate(agent);
}
//Reset variables
Density = 0f;
}
- Experiment Time - Takes time in seconds
- Directory - Takes path to save directory (Tip: Go to the directory you want the file in, right-click and select copy path)
-
File Name - Takes file name with no extension (All files are
.csv
)