EE308_LAB1-2

m0_51284439 2022-10-27 20:41:57

EE308_LAB1-2

ways of solving a problem

First of all, the general reading topic is divided into two parts. The first part is to identify the statistical keywords, and the second part is to identify the statistical code structure.
The first part is the first part. For the extraction of code keywords and statistics I think usinghash tables will be very easy to complete this part of the work.The specific idea is to retrieve the keywords in the hash table, and then add the counter if present. 1. Add a new key value pair if not present.
The second part is the structure identification specifically divided into three structures of the identification.
However, the identification idea of several structures is roughly the same.
Ststack the keywords and "{" and "}". Clear when the "}" heap goes into the stack, clear to the previous "{", and heap the cleared portion into the buffer.
The structure is analyzed into multi-level conditions, and the subsequent conditions will start to verify when the preconditions are completed.

1.switch case

Here the switch case structure is set to a two-level condition, with a precondition of switch stacking into the stack..
Turn on the switch when the precondition is reached, and count when the case enters the stack. And turn off the switch when the switch enters the buffer.
prefix condition : switch
decide condition : case

2.if else

The structure takes if as a precondition and counts and switches off when the else enters the stack.
prefix condition : if
decide condition : else

3.if else if else

This part will switch to the second structure, which I analyze as a three-level condition.
first condition : if else
second condition : else if
third condition :else
The first condition will use the judgment of the ifelse structure. Switch 1 will open as the counter of the ifelse increases.
The second switch tube will be open in the else if {} in the buffer.
The decision criteria will verify that the next entry keyword is else when the second switch is on.

The above is through the analysis after reading the problem.

the flow chart of the key functions

请添加图片描述

Code descriptionHashMap<String, Integer> map = new HashMap<String,Integer>();

    for (String li : lists) { 
        if(li.length()<=1) continue;
        if(!map.containsKey(li)) {//Detects if it is already in the table
            map.put(li, 1);
        }else {
            Integer count = map.get(li);
            map.put(li, ++count);
        }
    }



//type1 switch case
                //Open the switch after switch enters the stack
                if(i==0) {
                  sw1=true;
                  sw++;
                }
                if(sw1==true&&i==1) ca++;//Start the case counting after the switch is on
                //Turn off the switch after "}" enters the stack and return to the zero counter
                if(sw1==true&&i==5) {
                    System.out.println("number of switch"+sw+" case = "+ca);
                    ca=0;
                    sw1=false;
                }



//type2 if else
                //The if else only has an else decision condition, so it does not set up a switch
                if(i==3) type2++;


//type3 if, else if, else
                //Determine the precondition and complete the precondition and close the switch
                if(sw2==true) {
                    if(i==3) type3++;
                    sw2=false;
                }


if(li.equals(table[5])) {
            //type3 if, else if, else
             List<String> buffer = new ArrayList<String>();//Create the buffer judgment preconditions
            sw2=true;
            //Eliminate after the "}" goes into the stack 
            while(true) { 
                if(!st.empty()&&!st.peek().equals(table[4])) {
                    buffer.add(st.peek());
                    st.pop();
                }else break;
            }
            if(!st.empty()) {
                buffer.add(st.peek());
                st.pop();
            }
            while(true) { 
                if(!st.empty()&&!st.peek().equals(table[4])) {
                    buffer.add(st.peek());
                    st.pop();
                }else break;
            }
            //Judge the preconditions, the condition of the switch on
            if(buffer.size()==4) {
            for(int i=0;i<buffer.size();i++) {
                if(!buffer.get(i).equals(type3buffer[i])) {
                    sw2=false;
                    break;
                }
            }
            }else sw2=false;
        }
      
     }

psp

psptime
Planning10
Estimate60
Development50
Analysis30
Design Spec20
Design Review20
Coding Standard10
Design20
Coding20
Code Review40
Test10
Reporting50
Test Report30
Size Measurement10
Postmortem & Process Improvement Plan10
390
The Link Your Class
The Link of Requirement of This Assignmenthttps://github.com/if-ish/EE308FZ-Lab1-2-Individual-programing-work
The Aim of This AssignmentKeyword statistics and structure identification
MU STU ID and FZU STU ID<20124635_832002210>
...全文
286 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文围绕“基于超局部模型与自抗扰ESO观测器的无模型预测电流控制改进策略”展开研究,提出一种结合超局部模型(ULM)与扩张状态观测器(ESO)的无模型预测电流控制(MFPCC)改进方法,旨在提升永磁同步电机(PMSM)电流环的动态响应性能与抗干扰能力。该策略利用超局部模型对系统行为进行局部逼近,避免依赖精确数学模型,同时引入自抗扰控制中的ESO实时观测并补偿系统内外部扰动,有效抑制参数摄动、负载变化及模型不确定性带来的影响。研究通过Simulink搭建完整的控制系统仿真模型,对传统MFPCC与所提改进策略进行对比分析,验证了新方法在电流跟踪精度、响应速度和鲁棒性方面的优越性。; 适合人群:具备电机控制、现代控制理论及Simulink仿真基础的电气工程、自动化及相关专业的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于高性能电机驱动系统中电流环控制器的设计与优化;②为无模型控制与自抗扰控制的融合应用提供技术参考;③支撑相关课题的仿真验证、论文复现与创新方法研究。; 阅读建议:建议读者结合Simulink仿真模型深入理解控制结构与参数整定过程,重点关注ESO的观测性能与扰动补偿机制,并可通过改变负载条件、参数偏差等工况进行鲁棒性测试,进一步掌握该改进策略的核心优势与适用边界。

285

社区成员

发帖
与我相关
我的任务
社区描述
福州大学 梅努斯国际工程学院 软件工程(2022秋) 教学
软件工程 高校
社区管理员
  • LinQF39
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧