public override void OnEpisodeBegin() { m_ResetParams = Academy.Instance.EnvironmentParameters; rc.height = m_ResetParams.GetWithDefault("init_height", 550); rc.init_angle_roll = m_ResetParams.GetWithDefault("init_angle_roll", 5); rc.init_angle_pitch = m_ResetParams.GetWithDefault("init_angle_pitch", 90); rc.init_xoffset = m_ResetParams.GetWithDefault("init_xoffset", 15); rc.init_zoffset = m_ResetParams.GetWithDefault("init_zoffset", 90); rc.init_zspeed = m_ResetParams.GetWithDefault("init_zspeed", 1); rc.angle_tvc = m_ResetParams.GetWithDefault("angle_tvc", 7); rc.thrust_engine = m_ResetParams.GetWithDefault("thrust_engine", 5000); rc.thrust_rcs = m_ResetParams.GetWithDefault("thrust_rcs", 0.2f); rc.collision_speed = m_ResetParams.GetWithDefault("collision_speed", 5); episodeFinished = false; rc.ResetPosition(); }
public override void OnEpisodeBegin() { m_ResetParams = Academy.Instance.EnvironmentParameters; /* * if (m_ResetParams.GetWithDefault("init_height", 50) != rc.height) * { * Debug.Log("NOUVELLE LECON, SUR LA HAUTEUR INITIALE. ANCIENNE VALEUR:" + rc.height + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_height", 50)); * rc.height = m_ResetParams.GetWithDefault("init_height", 50); * } * * if (m_ResetParams.GetWithDefault("z_init_offset", 4) != rc.z_offset) * { * Debug.Log("NOUVELLE LECON, SUR LE XOFFSET INITIAL. ANCIENNE VALEUR:" + rc.z_offset + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("z_init_offset", 4)); * rc.z_offset = m_ResetParams.GetWithDefault("z_init_offset", 4); * } * * if (m_ResetParams.GetWithDefault("pitch_init_angle", 0) != rc.angle) * { * Debug.Log("NOUVELLE LECON, SUR LE ANGLE INITIAL. ANCIENNE VALEUR:" + rc.angle + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("pitch_init_angle", 0)); * rc.angle = m_ResetParams.GetWithDefault("pitch_init_angle", 0); * } * * if (m_ResetParams.GetWithDefault("z_init_speed", 0) != rc.z_init_speed) * { * Debug.Log("NOUVELLE LECON, SUR LE Z INIT SPEED. ANCIENNE VALEUR:" + rc.z_init_speed + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("z_init_speed", 0)); * rc.z_init_speed = m_ResetParams.GetWithDefault("z_init_speed", 0); * } * * if (m_ResetParams.GetWithDefault("tvc_angle", 5) != rc.TVCangle) * { * Debug.Log("NOUVELLE LECON, SUR LE TVCANGLE. ANCIENNE VALEUR:" + rc.TVCangle + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("tvc_angle", 5)); * rc.TVCangle = m_ResetParams.GetWithDefault("tvc_angle", 5); * } * * if (m_ResetParams.GetWithDefault("rcs_thrust", 2.5f) != rc.rcs_thurst) * { * Debug.Log("NOUVELLE LECON, SUR LE RCSTHRUST. ANCIENNE VALEUR:" + rc.rcs_thurst + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("rcs_thrust", 2.5f)); * rc.rcs_thurst = m_ResetParams.GetWithDefault("rcs_thrust", 2.5f); * } * * if (m_ResetParams.GetWithDefault("engine_thrust", 5000) != rc.engine_thrust) * { * Debug.Log("NOUVELLE LECON, SUR LE RCSTHRUST. ANCIENNE VALEUR:" + rc.engine_thrust + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("engine_thrust", 5000)); * rc.engine_thrust = m_ResetParams.GetWithDefault("engine_thrust", 5000); * } * * if (m_ResetParams.GetWithDefault("landing_speed", 5) != rc.landing_speed) * { * Debug.Log("NOUVELLE LECON, SUR LE landing_speed. ANCIENNE VALEUR:" + rc.landing_speed + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("landing_speed", 5)); * rc.landing_speed = m_ResetParams.GetWithDefault("landing_speed", 5); * } */ if (m_ResetParams.GetWithDefault("init_height", 50) != rc.height) { Debug.Log("NOUVELLE LECON, SUR LA init_height. ANCIENNE VALEUR:" + rc.height + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_height", 50)); rc.height = m_ResetParams.GetWithDefault("init_height", 50); } if (m_ResetParams.GetWithDefault("init_angle_roll", 0) != rc.init_angle_roll) { Debug.Log("NOUVELLE LECON, SUR LA init_angle_roll. ANCIENNE VALEUR:" + rc.init_angle_roll + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_angle_roll", 0)); rc.init_angle_roll = m_ResetParams.GetWithDefault("init_angle_roll", 0); } if (m_ResetParams.GetWithDefault("init_angle_pitch", 0) != rc.init_angle_pitch) { Debug.Log("NOUVELLE LECON, SUR LA init_angle_pitch. ANCIENNE VALEUR:" + rc.init_angle_pitch + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_angle_pitch", 0)); rc.init_angle_pitch = m_ResetParams.GetWithDefault("init_angle_pitch", 0); } if (m_ResetParams.GetWithDefault("init_xoffset", 4) != rc.init_xoffset) { Debug.Log("NOUVELLE LECON, SUR LA init_xoffset. ANCIENNE VALEUR:" + rc.init_xoffset + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_xoffset", 4)); rc.init_xoffset = m_ResetParams.GetWithDefault("init_xoffset", 4); } if (m_ResetParams.GetWithDefault("init_zoffset", 4) != rc.init_zoffset) { Debug.Log("NOUVELLE LECON, SUR LA init_zoffset. ANCIENNE VALEUR:" + rc.init_zoffset + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_zoffset", 4)); rc.init_zoffset = m_ResetParams.GetWithDefault("init_zoffset", 4); } if (m_ResetParams.GetWithDefault("init_zspeed", 0) != rc.init_zspeed) { Debug.Log("NOUVELLE LECON, SUR LA init_zspeed. ANCIENNE VALEUR:" + rc.init_zspeed + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("init_zspeed", 0)); rc.init_zspeed = m_ResetParams.GetWithDefault("init_zspeed", 0); } if (m_ResetParams.GetWithDefault("angle_tvc", 5) != rc.angle_tvc) { Debug.Log("NOUVELLE LECON, SUR LA angle_tvc. ANCIENNE VALEUR:" + rc.angle_tvc + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("angle_tvc", 5)); rc.angle_tvc = m_ResetParams.GetWithDefault("angle_tvc", 5); } if (m_ResetParams.GetWithDefault("thrust_engine", 4000) != rc.thrust_engine) { Debug.Log("NOUVELLE LECON, SUR LA thrust_engine. ANCIENNE VALEUR:" + rc.thrust_engine + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("thrust_engine", 4000)); rc.thrust_engine = m_ResetParams.GetWithDefault("thrust_engine", 4000); } if (m_ResetParams.GetWithDefault("thrust_rcs", 2.5f) != rc.thrust_rcs) { Debug.Log("NOUVELLE LECON, SUR LA thrust_rcs. ANCIENNE VALEUR:" + rc.thrust_rcs + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("thrust_rcs", 2.5f)); rc.thrust_rcs = m_ResetParams.GetWithDefault("thrust_rcs", 2.5f); } if (m_ResetParams.GetWithDefault("collision_speed", 5) != rc.collision_speed) { Debug.Log("NOUVELLE LECON, SUR LA collision_speed. ANCIENNE VALEUR:" + rc.collision_speed + ", NOUVELLE VALEUR:" + m_ResetParams.GetWithDefault("collision_speed", 5)); rc.collision_speed = m_ResetParams.GetWithDefault("collision_speed", 5); } rc.ResetPosition(); }