protected void GetConfiguration() { //get the configuration as this handy-dandy variable OCConfig config = OCConfig.Instance; //is there any configuration information about whether we should exit on completing these tests? if ((config.get(exitOnCompleteConfig)).ToString().CompareTo("neutral") != 0) { Debug.Log(OCLogSymbol.DEBUG + "Configuration says to exit Unit Tests on complete: " + config.get(exitOnCompleteConfig).ToString()); //then extract it in Boolean form! exitOnComplete = config.getBool(exitOnCompleteConfig); } //get the configuration for UNITTEST_ALL & whether or not the editor box is checked. bool runAll = config.getBool(testConfigRunAll) || this.editorSaysToRun; //zero out tests selected selectedTests = 0; //iterate through all the configurations and read them in! for (uint i = 0; i < numTests; i++) { configurations[i] = config.getBool(testConfigNames[i]) || runAll; if (configurations[i] == true) { selectedTests++; } } }
//--------------------------------------------------------------------------- #endregion #region Public Member Functions //--------------------------------------------------------------------------- void Awake() { _config = OCConfig.Instance; // Initialize parameters below. _modeCounts = new int[3]; _modeCounts[(int)AvatarMode.IDLE] = 0; _modeCounts[(int)AvatarMode.SLEEP] = 0; _modeCounts[(int)AvatarMode.ACTIVE] = 0; _millisecondsPerTick = _config.getLong("MILLISECONDS_PER_TICK"); this.IDLE_ENERGY_DECREASE_RATE = -_millisecondsPerTick / (MILLISECONDS_PER_DAY / _config.getInt("EAT_STOPS_PER_DAY")); this.SLEEP_ENERGY_INCREASE_RATE = -IDLE_ENERGY_DECREASE_RATE * 5; this.STARVING_ENERGY_DECREASE_RATE = IDLE_ENERGY_DECREASE_RATE * 2; this.FITNESS_DECREASE_OUTSIDE_HOME = _config.getFloat("FITNESS_DECREASE_OUTSIDE_HOME"); this.EAT_ENERGY_INCREASE = _config.getFloat("EAT_ENERGY_INCREASE"); this.EAT_POO_INCREASE = _config.getFloat("EAT_POO_INCREASE"); this.DRINK_THIRST_DECREASE = _config.getFloat("EAT_THIRST_DECREASE"); this.DRINK_PEE_INCREASE = _config.getFloat("DRINK_PEE_INCREASE"); _energy = _config.getFloat("INIT_ENERGY"); _fitness = _config.getFloat("INIT_FITNESS"); _currentMode = AvatarMode.IDLE; // this.AT_HOME_DISTANCE = config.getFloat("AT_HOME_DISTANCE"); // this.FITNESS_INCREASE_AT_HOME = config.getFloat("FITNESS_INCREASE_AT_HOME"); // this.at_home_flag = false; SetupBasicFactors(); _connector = OCConnectorSingleton.Instance; }
//--------------------------------------------------------------------------- #endregion //--------------------------------------------------------------------------- #region Public Member Functions //--------------------------------------------------------------------------- public void OnEnable() { _energyIncrease = 0.0f; _fitnessChange = 0.0f; _newAvatarMode = OCPhysiologicalModel.AvatarMode.ACTIVE; _changeFactors = new Dictionary <string, float>(); _changeFactors["hunger"] = 0.5f; _changeFactors["thirst"] = 0.5f; //_changeFactors["energy"] = 0.5f; //_changeFactors["fitness"] = 0.5f; _changeFactors["pee_urgency"] = 0.5f; _changeFactors["poo_urgency"] = 0.5f; _resetFactors = new List <string>(); config = OCConfig.Instance; }
//--------------------------------------------------------------------------- #endregion #region Public Member Functions //--------------------------------------------------------------------------- void Awake() { _config = OCConfig.Instance; // Initialize parameters below. _modeCounts = new int[3]; _modeCounts[(int)AvatarMode.IDLE] = 0; _modeCounts[(int)AvatarMode.SLEEP] = 0; _modeCounts[(int)AvatarMode.ACTIVE] = 0; _millisecondsPerTick = _config.getLong("MILLISECONDS_PER_TICK"); this.IDLE_ENERGY_DECREASE_RATE = - _millisecondsPerTick / (MILLISECONDS_PER_DAY / _config.getInt("EAT_STOPS_PER_DAY")); this.SLEEP_ENERGY_INCREASE_RATE = - IDLE_ENERGY_DECREASE_RATE * 5; this.STARVING_ENERGY_DECREASE_RATE = IDLE_ENERGY_DECREASE_RATE * 2; this.FITNESS_DECREASE_OUTSIDE_HOME = _config.getFloat("FITNESS_DECREASE_OUTSIDE_HOME"); this.EAT_ENERGY_INCREASE = _config.getFloat("EAT_ENERGY_INCREASE"); this.EAT_POO_INCREASE = _config.getFloat("EAT_POO_INCREASE"); this.DRINK_THIRST_DECREASE = _config.getFloat("EAT_THIRST_DECREASE"); this.DRINK_PEE_INCREASE = _config.getFloat("DRINK_PEE_INCREASE"); _energy = _config.getFloat("INIT_ENERGY"); _fitness = _config.getFloat("INIT_FITNESS"); _currentMode = AvatarMode.IDLE; // this.AT_HOME_DISTANCE = config.getFloat("AT_HOME_DISTANCE"); // this.FITNESS_INCREASE_AT_HOME = config.getFloat("FITNESS_INCREASE_AT_HOME"); // this.at_home_flag = false; SetupBasicFactors(); _connector = OCConnectorSingleton.Instance; }
//--------------------------------------------------------------------------- #endregion //--------------------------------------------------------------------------- #region Public Member Functions //--------------------------------------------------------------------------- public void OnEnable() { _energyIncrease = 0.0f; _fitnessChange = 0.0f; _newAvatarMode = OCPhysiologicalModel.AvatarMode.ACTIVE; _changeFactors = new Dictionary<string,float>(); _changeFactors["hunger"] = 0.5f; _changeFactors["thirst"] = 0.5f; //_changeFactors["energy"] = 0.5f; //_changeFactors["fitness"] = 0.5f; _changeFactors["pee_urgency"] = 0.5f; _changeFactors["poo_urgency"] = 0.5f; _resetFactors = new List<string>(); config = OCConfig.Instance; }