临时1

using System;
using System.Xml;
using System.Collections.Generic;
using UnityEngine;


namespace Arth.Config
{
    using MissionDic = Dictionary<int, DSceneData>;
    using tempDic = Dictionary<int, DChapterData>;
    using ChapterDic = Dictionary<int, Dictionary<int, DChapterData>>;
    
class DMapData : BaseData
{
//场景id
int _next_sceneid; //下一场景id
public int next_sceneid{ get { return _next_sceneid; } }
string _name; //场景名
public string name{ get { return _name; } }
string _describe; //场景描述
public string describe{ get { return _describe; } }
int _level; //地图开启等级
public int level{ get { return _level; } }


public DMapData()
{


}


public override void init(XmlElement element)
{
base.init(element);


string tempBuff;
string [] tempStrArray;
int.TryParse(element.GetAttribute("next_sceneid"), out _next_sceneid);


_describe = element.GetAttribute("describe");


_name = element.GetAttribute("name");


int.TryParse(element.GetAttribute("level"), out _level);


}
}


    class ASceneData : BaseData
    {
        //关卡id
        int _icon_id; //关卡图标id
        public int icon_id { get { return _icon_id; } }
        int _pos_x; //图标起始
        public int pos_x { get { return _pos_x; } }
        int _pos_y; //图标起始
        public int pos_y { get { return _pos_y; } }
        int _size_x; //图标大小
        public int size_x { get { return _size_x; } }
        int _size_y; //图标大小
        public int size_y { get { return _size_y; } }
        string _obj_path; //图标材质
        public string obj_path { get { return _obj_path; } }


        public ASceneData()
        {


        }


        public override void init(XmlElement element)
        {
            base.init(element);


            int.TryParse(element.GetAttribute("pos_x"), out _pos_x);


            int.TryParse(element.GetAttribute("pos_y"), out _pos_y);


            int.TryParse(element.GetAttribute("icon_id"), out _icon_id);


            int.TryParse(element.GetAttribute("size_x"), out _size_x);


            int.TryParse(element.GetAttribute("size_y"), out _size_y);


            _obj_path = element.GetAttribute("obj_path");


        }
    }


   class DSceneData : BaseData
{
//关卡id
int _map_id; //地图ID
public int map_id{ get { return _map_id; } }
int _chapter_id; //章节ID
public int chapter_id{ get { return _chapter_id; } }
string _name; //章节点名称
public string name{ get { return _name; } }
string _describe; //章节点描述
public string describe{ get { return _describe; } }
int _mission_type; //1.章节类功能
//2.商店类功能
//3.竞技场类功能
//4.兵营功能
//5.采集点功能
//6.宝箱类功能
//7.异界之地功能点
public int mission_type{ get { return _mission_type; } }
int _next_mission1_map; //下一关卡1
public int next_mission1_map{ get { return _next_mission1_map; } }
int _next_mission1_chapter; //下一关卡1
public int next_mission1_chapter{ get { return _next_mission1_chapter; } }
int _next_mission2_map; //下一关卡2
public int next_mission2_map{ get { return _next_mission2_map; } }
int _next_mission2_chapter; //下一关卡2
public int next_mission2_chapter{ get { return _next_mission2_chapter; } }
int _hide; //是否隐藏
public int hide{ get { return _hide; } }
int _condition; //显示条件
//1.城主等级
//2.接取某一任务
//3.完成某一任务
//4.完成某一关卡点
public int condition{ get { return _condition; } }
int _param; //条件参数
public int param{ get { return _param; } }


public DSceneData()
{


}


public override void init(XmlElement element)
{
base.init(element);


string tempBuff;
string [] tempStrArray;
int.TryParse(element.GetAttribute("chapter_id"), out _chapter_id);


int.TryParse(element.GetAttribute("map_id"), out _map_id);


_name = element.GetAttribute("name");


_describe = element.GetAttribute("describe");


int.TryParse(element.GetAttribute("param"), out _param);


int.TryParse(element.GetAttribute("next_mission2_map"), out _next_mission2_map);


int.TryParse(element.GetAttribute("hide"), out _hide);


int.TryParse(element.GetAttribute("next_mission1_chapter"), out _next_mission1_chapter);


int.TryParse(element.GetAttribute("next_mission1_map"), out _next_mission1_map);


int.TryParse(element.GetAttribute("next_mission2_chapter"), out _next_mission2_chapter);


int.TryParse(element.GetAttribute("condition"), out _condition);


int.TryParse(element.GetAttribute("mission_type"), out _mission_type);


}
}

    class AChapterData
    {
        public AChapterData(XmlElement element)
        {
            int.TryParse(element.GetAttribute("id"), out _IconID);


            _PrefabPath = element.GetAttribute("prefab_path");
        }


        int _IconID;
        public int IconID { get { return _IconID; } }
        string _PrefabPath;
        public string PrefabPath { get { return _PrefabPath; } }
    }


    class DChapterData
    {
        public DChapterData(XmlElement element)
        {
            int.TryParse(element.GetAttribute("chapter_id"), out _ChapterID);
            int.TryParse(element.GetAttribute("map_id"), out _MapID);
            int.TryParse(element.GetAttribute("scene_id"), out _SceneID);
            int.TryParse(element.GetAttribute("icon_id"), out _IconID);
            int.TryParse(element.GetAttribute("energy"), out _Energy);
            int.TryParse(element.GetAttribute("battleid"), out _Battle);


            _Dialog_Begin_ID = element.GetAttribute("dialog_begin_id");
            _Dialog_End_ID = element.GetAttribute("dialog_end_id");
            _Name = element.GetAttribute("chapter_name");
            _Desc = element.GetAttribute("desc_name");
        }


        int _ChapterID;
        public int ChapterID { get { return _ChapterID; } }
        int _MapID;
        public int MapID { get { return _MapID; } }
        int _SceneID;
        public int SceneID { get { return _SceneID; } }
        int _IconID;
        public int IconID { get { return _IconID; } }
        int _Energy;
        public int Energy { get { return _Energy; } }
        int _Battle;
        public int Battle { get { return _Battle; } }
        string _Dialog_Begin_ID;
        public string Dialog_Begin_ID { get { return _Dialog_Begin_ID; } }
        string _Dialog_End_ID;
        public string Dialog_End_ID { get { return _Dialog_End_ID; } }
        string _Name;
        public string Name { get { return _Name; } }
        string _Desc;
        public string Desc { get { return _Desc; } }
    }


    class MissionDataList
    {
        private MissionDataList() { }


        private static MissionDataList instance = null;


        public static MissionDataList Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new MissionDataList();
                }
                return instance;
            }
        }


        public void Load()
        {
            string AChapterDataPath = "Configs/a-Chapter";
            string DChapterDataPath = "Configs/d-Chapter";


            // load a-Charpter
            XmlDocument doc = Config.ConfigFileUtility.ReadXml(AChapterDataPath);
            XmlNodeList nodelist = doc.SelectSingleNode("a-Chapter").ChildNodes;
            foreach (var node in nodelist)
            {
                XmlElement element = (XmlElement)node;
                AChapterData chapterData = new AChapterData(element);
                m_AChapterDataList.Add(chapterData.IconID, chapterData);
            }


            // load d-Charpter
            doc = Config.ConfigFileUtility.ReadXml(DChapterDataPath);
            nodelist = doc.SelectSingleNode("d-Chapter").ChildNodes;
            foreach (var node in nodelist)
            {
                XmlElement element = (XmlElement)node;
                DChapterData chapterData = new DChapterData(element);


                Debug.Log("map: " + chapterData.MapID
                    + ", " + "scene: " + chapterData.SceneID
                    + ", " + "chapter: " + chapterData.ChapterID);
                addChapterData(chapterData);
            }


            // if there has some relationship between a-Hero and d-Hero, establish these here.
//             for (int i = 1; i <= m_DChapterDataList.Count; ++i)
//             {
//                 for (int j = 1; j <= m_DChapterDataList[i].Count; ++j)
//                 {
//                     for (int k = 1; k <= m_DChapterDataList[i][j].Count; ++k)
//                     {
//                         DChapterData data = m_DChapterDataList[i][j][k];
//                         Debug.Log(data.SceneID.ToString() + " " +
//                             data.MissionID.ToString() + " " +
//                             data.ChapterID.ToString() + " " +
//                             data.Desc + " " + data.Name + " " + data.Energy.ToString());
//                     }
//                 }
//             }
        }


        private void addChapterData(DChapterData chapterData)
        {
            if (m_DChapterDataList.ContainsKey(chapterData.MapID))
            {
                if (m_DChapterDataList[chapterData.MapID].ContainsKey(chapterData.SceneID))
                {
                    if (m_DChapterDataList[chapterData.MapID][chapterData.SceneID].ContainsKey(
                        chapterData.ChapterID))
                    {
                        // what's the fucking problem?
                    }
                    else
                    {
                        m_DChapterDataList[chapterData.MapID][chapterData.SceneID].Add(
                            chapterData.ChapterID, chapterData);
                    }
                }
                else
                {
                    Dictionary<int, DChapterData> chapter =
                        new Dictionary<int, DChapterData>();
                    m_DChapterDataList[chapterData.MapID].Add(chapterData.SceneID, chapter);


                    addChapterData(chapterData);
                }
            }
            else
            {
                Dictionary<int, Dictionary<int, DChapterData>> mission =
                    new Dictionary<int, Dictionary<int, DChapterData>>();
                m_DChapterDataList.Add(chapterData.MapID, mission);


                addChapterData(chapterData);
            }
        }


        public DChapterData GetChapterData(int sceneId, int missionId, int chapterId)
        {
            if (m_DChapterDataList.ContainsKey(sceneId))
            {
                if (m_DChapterDataList[sceneId].ContainsKey(missionId))
                {
                    if (m_DChapterDataList[sceneId][missionId].ContainsKey(chapterId))
                        return m_DChapterDataList[sceneId][missionId][chapterId];
                }
            }


            return null;
        }


        public int GetChapterCount(int mapId, int sceneId)
        {
            if (m_DChapterDataList.ContainsKey(mapId))
            {
                if (m_DChapterDataList[mapId].ContainsKey(sceneId))
                {
                    return m_DChapterDataList[mapId][sceneId].Count;
                }
            }


            return 0;
        }


        public void Release()
        {
            // if there has some relationship between a-Hero and d-Hero, disestablish these here.


            foreach (KeyValuePair<int, ChapterDic> node1 in m_DChapterDataList)
            {
                foreach (KeyValuePair<int, tempDic> node2 in node1.Value)
                {
                    node2.Value.Clear();
                }
                node1.Value.Clear();
            }


            m_DSceneDataList.Clear();
        }


        public void ReLoad()
        {
            Release();
            Load();
        }


        public int GetMissionCount(int sceneId)
        {
            if (m_DMissionDataList.ContainsKey(sceneId))
                return m_DMissionDataList[sceneId].Count;
            else
                return 0;
        }


        public DSceneData GetDSceneData(int sceneId)
        {
            if (m_DSceneDataList.ContainsKey(sceneId))
            {
                return m_DSceneDataList[sceneId];
            }


            return null;
        }


        public int GetSceneCount()
        {
            return m_DSceneDataList.Count;
        }


        private Dictionary<int, MissionDic> m_DMissionDataList = new Dictionary<int, MissionDic>();
        private Dictionary<int, DSceneData> m_DSceneDataList = new Dictionary<int, DSceneData>();
        private Dictionary<int, AChapterData> m_AChapterDataList = new Dictionary<int, AChapterData>();
        private Dictionary<int, ChapterDic> m_DChapterDataList = new Dictionary<int, ChapterDic>();
    }
}
内容概要:本文档围绕六自由度机械臂的ANN人工神经网络设计展开,涵盖正向与逆向运动学求解、正向动力学控制,并采用拉格朗日-欧拉法推导逆向动力学方程,所有内容均通过Matlab代码实现。同时结合RRT路径规划与B样条优化技术,提升机械臂运动轨迹的合理性与平滑性。文中还涉及多种先进算法与仿真技术的应用,如状态估计中的UKF、AUKF、EKF等滤波方法,以及PINN、INN、CNN-LSTM等神经网络模型在工程问题中的建模与求解,展示了Matlab在机器人控制、智能算法与系统仿真中的强大能力。; 适合人群:具备一定Ma六自由度机械臂ANN人工神经网络设计:正向逆向运动学求解、正向动力学控制、拉格朗日-欧拉法推导逆向动力学方程(Matlab代码实现)tlab编程基础,从事机器人控制、自动化、智能制造、人工智能等相关领域的科研人员及研究生;熟悉运动学、动力学建模或对神经网络在控制系统中应用感兴趣的工程技术人员。; 使用场景及目标:①实现六自由度机械臂的精确运动学与动力学建模;②利用人工神经网络解决传统解析方法难以处理的非线性控制问题;③结合路径规划与轨迹优化提升机械臂作业效率;④掌握基于Matlab的状态估计、数据融合与智能算法仿真方法; 阅读建议:建议结合提供的Matlab代码进行实践操作,重点理解运动学建模与神经网络控制的设计流程,关注算法实现细节与仿真结果分析,同时参考文中提及的多种优化与估计方法拓展研究思路。
内容概要:本文围绕电力系统状态估计中的异常检测与分类展开,重点介绍基于Matlab代码实现的相关算法与仿真方法。文章详细阐述了在状态估计过程中如何识别和分类量测数据中的异常值,如坏数据、拓扑错误和参数误差等,采用包括残差分析、加权最小二乘法(WLS)、标准化残差检测等多种经典与现代检测手段,并结合实际算例验证方法的有效性。同时,文档提及多种状态估计算法如UKF、AUKF、EUKF等在负荷突变等动态场景下的应用,强调异常处理对提升电力系统运行可靠性与安全性的重要意义。; 适合人群:具备电力系统基础知识和一定Matlab编程能力的高校研究生、科研人员及从事电力系【状态估计】电力系统状态估计中的异常检测与分类(Matlab代码实现)统自动化相关工作的工程技术人员。; 使用场景及目标:①掌握电力系统状态估计中异常数据的产生机制与分类方法;②学习并实现主流异常检测算法,提升对状态估计鲁棒性的理解与仿真能力;③服务于科研项目、课程设计或实际工程中的数据质量分析环节; 阅读建议:建议结合文中提供的Matlab代码进行实践操作,配合电力系统状态估计的基本理论进行深入理解,重点关注异常检测流程的设计逻辑与不同算法的性能对比,宜从简单案例入手逐步过渡到复杂系统仿真。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值