EE308 Lab2

qq_60095079 qq_60095079 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
The Link Your Classhttps://bbs.csdn.net/forums/MUEE308FZU202201
The Link of Requirement of This Assignment

https://bbs.csdn.net/topics/608745426

The Aim of This AssignmentFor independent programming, version control(git)
MU STU ID and FZU STU ID20124856_832001222

1.PSP form for this work.

Process StagesWorkTime
Pre-workRead the requirements and install git25min
DesignDesign program execution flow30min
CodingCoding implementation process30min
TestThe output of the test code10min
CommitSubmit the code to GitHub5min
FinalSum up the experience 30min

 

GitHub:PassWordddd/Lab1-2 (github.com)

2.Problem-solving ideas

1.How to Read a File

2.How do I get the code in the file

3.How do I remove symbols from my code

4.Design data structures to hold statistical results

3.Implementation process.

 4.Code description

4.1 Read the code in the file and remove symbols

while line:
    line = f.readline()
    line = line[:-1]
    line = line.replace("else if", "else-if")
    x = re.split(' |\(|\;|\\t|\:|\{|\/\/', line)
    for i in x:
        for j in range(kwd_len):
            if i == kwdlst[j]:
                if i == "switch":
                    num0s.append(num0)
                    num0 = 0
                if i == "case":
                    num0 += 1
                count[j] += 1
    for i in x:
        if i == "if" or i == "else" or i == "else-if":
            sentences.append(x)
            continue
f.close()

4.2 Statistics the total number of all keywords & Switch-case

for i in range(kwd_len):
    if count[i] != 0:
        sumres += count[i]
        if (i == 30):
            sumres += count[i]

4.3 Statistics of the if if-else if-else-if-else structure

for j in range(x_len):
    for i in sentences:
        if i[j] == "if":
            flag_if = 1
        if i[j] == "else-if":
            flag_else_if = 1
        if i[j] == "else":
            if flag_else_if == 1:
                num_if_else_if_else += 1
            elif flag_if == 1:
                num_if_else += 1
            flag_else_if = 0
            flag_else = 0

5.Test results

"D:\Program Files\Python38\python.exe" D:\worksapce\lab1-2\Lab2.py 
level of stastic (from 1 to 4): 4
sum :  35
switch  num :  2
case num [3, 2]
if-else num: 1
if-elseif-else num: 1

6.Summarize

In this assignment, I learned the combination of git and PyCharm and the importance of version control in code development, which laid a solid foundation for future code development. 

 

...全文

相关推荐

EE-308 LAB4 final version.7z

这是本次实验的压缩包

晨起剪桃花

机械三维3D设计图-等离子清洗机.zip

机械三维3D设计图-等离子清洗机.zip

ZL4120505

【无人车路径跟踪】基于神经网络的数据驱动迭代学习控制(ILC)算法,用于具有未知模型和重复任务的非线性单输入单输出(SISO)离散时间系统的无人车的路径跟踪(Matlab代码实现)

内容概要:本文提出了一种基于神经网络的数据驱动迭代学习控制(ILC)算法,专门针对具有未知动态模型和重复任务需求的非线性单输入单输出(SISO)离散时间系统,应用于无人车路径跟踪问题,并提供了完整的Matlab代码实现。该方法充分利用神经网络强大的非线性逼近能力和数据驱动特性,结合迭代学习控制在周期性任务中逐次提升控制性能的优势,无需依赖被控对象的精确数学模型,即可实现对期望轨迹的高精度、渐进式跟踪。文中系统阐述了算法的整体架构设计、关键控制律的构建方式、权重更新机制以及在无人车系统中的具体实施流程,展示了其在复杂非线性环境下的有效性和鲁棒性。; 适合人群:具备自动控制理论、机器学习基础知识和Matlab编程能力的研究生、科研人员,以及从事自动驾驶、智能控制、机器人控制等领域的工程技术人员。; 使用场景及目标:①解决无人车、工业机器人等在执行重复性路径任务时的高精度轨迹跟踪问题;②为研究数据驱动控制、迭代学习控制与神经网络的深度融合提供一个完整的仿真案例和技术参考;③辅助研究人员复现先进控制算法,服务于学术论文的验证、课题研究或实际工程项目的技术预研。; 阅读建议:建议读者在学习过程中紧密结合所提供的Matlab代码,深入剖析算法各模块的具体实现逻辑,推荐预先掌握迭代学习控制的基本原理和神经网络的相关知识,并通过Simulink搭建仿真环境,进行不同工况下的实验验证,以深刻理解算法的控制效果、收敛特性及关键参数的调优策略。

欢多天天写代码

机械三维3D设计图-线圈自动包绝缘胶纸机.zip

机械三维3D设计图-线圈自动包绝缘胶纸机.zip

ZL4120505

MATLABSimulink模拟及会议论文,关于具备自动温度控制和能耗分析的智能太阳能热水系统。.zip

1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

海神之光
评论
收藏 已收藏
分享
返回顶部