-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathExperimentConfig.h
34 lines (27 loc) · 1.74 KB
/
ExperimentConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <G3D/G3D.h>
#include "FpsConfig.h"
#include "TargetEntity.h"
#include "Session.h"
/** Experiment configuration */
class ExperimentConfig : public FpsConfig {
public:
String description = "Experiment"; ///< Experiment description
Array<SessionConfig> sessions; ///< Array of sessions
Array<TargetConfig> targets; ///< Array of trial configs
bool closeOnComplete = false; ///< Close application on all sessions complete
ExperimentConfig() { init(); }
ExperimentConfig(const Any& any);
void init();
static ExperimentConfig load(const String& filename, bool saveJSON = false); // Get the experiment config from file
Any toAny(const bool forceAll = false) const;
void getSessionIds(Array<String>& ids) const; // Get an array of session IDs
shared_ptr<SessionConfig> getSessionConfigById(const String& id) const; // Get a session config based on its ID
int getSessionIndex(const String& id) const; // Get the index of a session in the session array (by ID)
shared_ptr<TargetConfig> getTargetConfigById(const String& id) const; // Get a pointer to a target config by ID
Array<Array<shared_ptr<TargetConfig>>> getTargetsByTrial(const String& id) const; // Get target configs by trial (not recommended for repeated calls)
Array<Array<shared_ptr<TargetConfig>>> getTargetsByTrial(int sessionIndex) const; // Get target configs by trial (not recommended for repeated calls)
Array<shared_ptr<TargetConfig>> getSessionTargets(const String& id) const; // Get all targets affiliated with a session (not recommended for repeated calls)
bool validate(bool throwException) const; // Validate the session/target configuration
void printToLog() const; // Print the config to the log
};