public void InputParametersFromXML(string file_path) { serializeDataPath = Application.dataPath + file_path; GaussianPolicyModel buf = XmlUtil.Deserialize <GaussianPolicyModel>(serializeDataPath); int num_of_kernel = buf.m_GaussianKernel.Length; int state_dimension = buf.m_GaussianKernel[0].m_KernelCenter.Length; Debug.LogFormat("loarding xml info... num: {0} / dim: {1}", num_of_kernel, state_dimension); m_Mean = new double[num_of_kernel]; for (int i = 0; i < num_of_kernel; i++) { //Debug.LogFormat("i = [{0}]", i); m_Mean[i] = buf.m_Mean[i]; } m_StandDev = buf.m_StandDev; m_GaussianKernel = new GaussianKernel[num_of_kernel]; for (int i = 0; i < num_of_kernel; i++) { m_GaussianKernel[i] = new GaussianKernel(state_dimension); m_GaussianKernel[i] = (GaussianKernel)buf.m_GaussianKernel[i]; } //Debug.LogFormat("okok"); //for (int i = 0; i < state_dimension; i++) //{ // double kc = m_GaussianKernel[1].m_KernelCenter[i]; // //Debug.LogFormat("kc: {0}", kc); //} }
/* */ public GaussianPolicyModel(int num_of_kernel, int state_dimension) { //initialize Policy Model m_Mean = new double[num_of_kernel]; m_StandDev = 1.0f; m_State = new double[state_dimension]; //initialize Gaussian Kernel m_GaussianKernel = new GaussianKernel[num_of_kernel]; for (int i = 0; i < num_of_kernel; i++) { m_GaussianKernel[i] = new GaussianKernel(state_dimension); } }