protected override void shutdown() { if (m_igym != null) { m_igym.Close(); m_igym = null; } }
protected override DatasetDescriptor get_dataset_override(int nProjectID) { if (m_igym == null) { m_igym = m_colGyms.Find(m_strName); } return(m_igym.GetDataset(DATA_TYPE.VALUES)); }
protected override void initialize(InitializeArgs e) { m_igym = m_colGyms.Find(m_strName); m_log = e.OutputLog; m_igym.Initialize(m_log, m_properties); m_sw.Start(); }
private void initialize(Log log) { if (m_igym == null) { m_log = log; m_igym = m_colGyms.Find(m_strName); m_igym.Initialize(m_log, m_properties); } }
protected override void initialize(InitializeArgs e) { m_igym = m_colGyms.Find(m_strName); m_log = e.OutputLog; m_bNormalizeInput = m_properties.GetPropertyAsBool("NormalizeInput", false); m_igym.Initialize(m_log, m_properties); m_sw.Start(); }
private void lstItems_MouseDoubleClick(object sender, MouseEventArgs e) { ListViewHitTestInfo hti = lstItems.HitTest(e.Location); if (hti == null) { return; } m_selectedGym = hti.Item.Tag as IXMyCaffeGym; DialogResult = DialogResult.OK; }
protected override DatasetDescriptor get_dataset_override(int nProjectID) { IXMyCaffeGym igym = m_igym; if (igym == null) { igym = m_colGyms.Find(m_strName); } m_ds = igym.GetDataset(DATA_TYPE.BLOB); return(m_ds); }
/// <summary> /// The Initialize method loads the gym specified. /// </summary> /// <param name="strGym">Specifies the name of the gym to load.</param> /// <param name="strParam">Specifies the semi-colon separated parameters passed to the gym.</param> /// <returns>0 is returned on success.</returns> /// <remarks> /// The following gyms are supported: 'ATARI', 'Cart-Pole' /// </remarks> public int Initialize(string strGym, string strParam) { m_log.EnableTrace = true; GymCollection col = new GymCollection(); col.Load(); m_igym = col.Find(strGym); if (m_igym == null) { throw new Exception("Could not find the gym '" + strGym + "'!"); } m_igym.Initialize(m_log, new PropertySet(strParam)); return(0); }
/// <summary> /// Renders the Gym visualizations. /// </summary> /// <param name="bShowUi">Specifies whether or not to render for the user interface.</param> /// <param name="strName">Specifies the Gym name.</param> /// <param name="rgData">Specifies the Gym data.</param> /// <param name="bmp">Specifies the Gym image to use.</param> public void Render(bool bShowUi, string strName, double[] rgData, Image bmp) { m_strName = strName; IXMyCaffeGym igym = m_colGym.Find(strName); if (bmp != null) { m_bmp = new Bitmap(bmp); } else { m_bmp = igym.Render(bShowUi, Width, Height, rgData, false).Item1; } if (IsHandleCreated && Visible) { Invalidate(true); } }
private void btnOpen_Click(object sender, EventArgs e) { m_selectedGym = lstItems.SelectedItems[0].Tag as IXMyCaffeGym; }