国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫(xiě)COMP9021object-oriented Python  程序
代寫(xiě)COMP9021object-oriented Python  程序

時(shí)間:2025-11-08  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



Assignment 2
COMP9021, Trimester 3, 2025
1 General matters
1.1 Aim
The purpose of the assignment is to:
• develop object-oriented Python programs with proper exception handling;
• parse and analyse combinatorial structures;
• generate TikZ/LaTeX diagrams programmatically;
• handle both small and complex structures efficiently.
1.2 Submission
Your program should be stored in a file named arches.py, optionally together with additional files. After
developing and testing your program, upload it via Ed (unless you worked directly in Ed). Assignments
can be submitted multiple times; only the last submission will be graded. Your assignment is due on
November 24 at 11:59am.
1.3 Assessment
The assignment is worth 13 marks and will be tested against multiple inputs. For each test, the au tomarking script allows your program to run for 30 seconds.
Assignments may be submitted up to 5 days after the deadline. The maximum mark decreases by 5% for
each full late day, up to a maximum of five days. For example, if students A and B submit assignments
originally worth 12 and 11 marks, respectively, two days late (i.e., more than 24 hours but no more than
48 hours late), the maximum mark obtainable is 11.7. Therefore, A receives min(11.7, 12) = 11.7 and B
receives min(11.7, 11) = 11.
Your program will generate a number of .tex files. These can be given as arguments to pdflatex to
produce PDF files. Only the .tex files will be used to assess your work, but generating the PDFs should
still give you a sense of satisfaction. The outputs of your programs must exactly match the expected
outputs. You are required to use the diff command to identity any differences between
the .tex files generated by your program and the provided reference .tex files. You are
responsible for any failed tests resulting from formatting discrepancies that diff would have
detected.
1.4 Reminder on plagiarism policy
You are encouraged to discuss strategies for solving the assignment with others; however, discussions
must focus on algorithms, not code. You must implement your solution independently. Submissions are
routinely scanned for similarities that arise from copying, modifying others’ work, or collaborating too
closely on a single implementation. Severe penalties apply.
1
2 Open Meanders
2.1 Background
An open meander is a combinatorial structure represented as a non-self-intersecting curve that crosses a
horizontal line of points, forming arches above and below the line. They can be described by permutations
with specific constraints.
Formally, let (a1, a2, . . . , an) be a permutation of {1,…, n} with n ≥ 2. Each integer corresponds to a
distinct point on a fixed horizontal line. The permutation defines a sequence of arches as follows:
• The first arch is an upper arch, drawn above the line.
• Subsequent arches alternate between upper and lower positions, forming a valid open meander.
• Each arch connects two consecutive points ai and ai+1 in the permutation. The orientation of each
arch depends on the relative order of these points:
– An arch is drawn from left to right if ai < ai+1.
– An arch is drawn from right to left if ai > ai+1.
• Arches on the same side do not intersect.
The collection of upper and lower arches can be represented symbolically using extended Dyck words—
one for each side of the line:
• ( corresponds to the left endpoint of an arch.
• ) corresponds to the right endpoint of an arch.
• 1 represents an end of the curve (a free endpoint) that lies on that side.
The position of the endpoints depends on the parity of n:
• For even n, both ends of the curve lie below the line.
• For odd n, one end lies above and the other below the line.
Each extended Dyck word therefore encodes the complete structure of the arches on its respective side,
though only together do the two sides represent the full open meander.
2.2 Examples
For a first example, consider the permutation (2, 3, 1, 4) and the corresponding generated diagram open_me anders_1.pdf.
• Upper arches extended Dyck word: (())
• Lower arches extended Dyck word: (1)1
For a second example, consider the permutation (1, 10, 9, 4, 3, 2, 5, 8, 7, 6) and the corresponding generated
diagram open_meanders_2.pdf.
2
• Upper arches extended Dyck word: (()((())))
• Lower arches extended Dyck word: 1(())1()()
For a third example, consider the permutation (5, 4, 3, 2, 6, 1, 7, 8, 13, 9, 10, 11, 12) and the corresponding
generated diagram open_meanders_3.pdf.
• Upper arches extended Dyck word: (()())()(()1)
• Lower arches extended Dyck word: ((()1))(()())
2.3 Requirements
Implement in arches.py a class OpenMeanderError(Exception) and a class OpenMeander.
Objects of type OpenMeander are created with OpenMeander(a_1, a_2, ..., a_n), where the arguments
form a permutation of {1,…, n} for some n ≥ 2. You may assume that all arguments are integers.
• If the arguments do not form a permutation of {1,…, n} for some n ≥ 2, raise
OpenMeanderError('Not a permutation of 1, ..., n for some n ≥ 2').
• If they do not define a valid open meander, raise
OpenMeanderError('Does not define an open meander').
Implement in OpenMeander three attributes:
• extended_dyck_word_for_upper_arches, a string representing the upper arches;
• extended_dyck_word_for_lower_arches, a string representing the lower arches;
• draw(filename, scale=1), a method that generates a TikZ/LaTeX file drawing the open meander.
No error checking is required in the implementation of draw(filename, scale=1). You may assume that
filename is a valid string specifying a writable file name, and that scale is an integer or floating-point
number (typically chosen so that the resulting picture fits on a page).
An example interaction is shown in open_meanders.pdf.
Carefully study the three example .tex files. Note that the horizontal baseline extends one unit beyond
each end of the curve. Also note that the scale common to x and y, as well as the values for radius, are
displayed as floating-point numbers with a single digit after the decimal point. The length of the ends of
strings is computed as half of the scale of x and y, and is also displayed as a floating-point number with
a single digit after the decimal point.
3 Dyck Words and Arch Diagrams
3.1 Background
A Dyck word is a balanced string of parentheses representing a system of nested arches above a horizontal
line. The depth of an arch is the number of arches it is nested within, providing a way to analyse the
hierarchical structure.
3
For example, the Dyck word (()(()(()))) contains arches of depth 0, 1, 2, and 3. Dyck words can be
visualised as arches drawn above a horizontal line, with nesting reflected in the vertical stacking of arches.
Unlike open meanders, Dyck words involve only one side of arches (above the line) and do not include
endpoints represented by 1. They provide a simplified context for studying nesting depth and arch
diagrams, and arches can optionally be visually distinguished by color according to their depth.
When colouring is applied, the following sequence is used: Red, Orange, Goldenrod, Yellow, LimeGreen,
Green, Cyan, SkyBlue, Blue, Purple. If the maximum depth exceeds 9, the sequence wraps around. For
example, depth 10 would use Red again, depth 11 Orange, etc.
3.2 Examples
For a first example, consider the Dyck word (((((((((((((()))))))))))))) and the corresponding
generated diagrams, drawn_dyck_word_1.pdf and coloured_dyck_word_1.pdf.
• There is 1 arch of depth 0.
• There is 1 arch of depth 1.
• There is 1 arch of depth 2.
• There is 1 arch of depth 3.
• There is 1 arch of depth 4.
• There is 1 arch of depth 5.
• There is 1 arch of depth 6.
• There is 1 arch of depth 7.
• There is 1 arch of depth 8.
• There is 1 arch of depth 9.
• There is 1 arch of depth 10.
• There is 1 arch of depth 11.
• There is 1 arch of depth 12.
• There is 1 arch of depth 13.
For a second example, consider the Dyck word (()(()(()))) and the corresponding generated diagrams,
drawn_dyck_word_2.pdf and coloured_dyck_word_2.pdf.
• There are 3 arches of depth 0.
• There is 1 arch of depth 1.
• There is 1 arch of depth 2.
• There is 1 arch of depth 3.
For a third example, consider the Dyck word ((()())(()(()()))) and the corresponding generated
diagrams, drawn_dyck_word_3.pdf and coloured_dyck_word_3.pdf.
4
• There are 5 arches of depth 0.
• There are 2 arches of depth 1.
• There is 1 arch of depth 2.
• There is 1 arch of depth 3.
For a fourth example, consider the Dyck word ((()(()())(()(()(())))((()()))()(()()))) and the
corresponding generated diagrams, drawn_dyck_word_4.pdf and coloured_dyck_word_4.pdf.
• There are 11 arches of depth 0.
• There are 4 arches of depth 1.
• There are 2 arches of depth 2.
• There is 1 arch of depth 3.
• There is 1 arch of depth 4.
• There is 1 arch of depth 5.
3.3 Requirements
Implement in arches.py a class DyckWordError(Exception) and a class DyckWord.
Objects of type DyckWord are created with DyckWord(s), where the argument s is a nonempty string of
parentheses. You may assume that the argument is a string.
• If the argument is the empty string, raise
DyckWordError('Expression should not be empty').
• Otherwise, if the argument contains characters other than parentheses, raise
DyckWordError("Expression can only contain '(' and ')'").
• Otherwise, if the string is not balanced, raise
DyckWordError('Unbalanced parentheses in expression').
Implement in DyckWord three attributes:
• report_on_depths(), a method that outputs the number of arches at each depth, ordered from
smallest to largest depth;
• draw_arches(filename, scale=1), a method that generates a TikZ/LaTeX file drawing the arches;
• colour_arches(filename, scale=1), a method that generates a TikZ/LaTeX file drawing the
arches coloured according to their depth.
5
No error checking is required in the implementation of both methods. You may assume that filename
is a valid string specifying a writable file name, and that scale is an integer or floating-point number
(typically chosen so that the resulting picture fits on a page).
An example interaction is shown in dyck_words.pdf.
Carefully study the eight example .tex files (four for drawing arches, four for colouring arches). Note
that the horizontal baseline extends one unit beyond the leftmost and rightmost arches. Note that the
scale common to x and y is displayed as a floating-point number with a single digit after the decimal
point. Arches are drawn from the leftmost left end to the rightmost left end. Arches are coloured
from largest depth to smallest depth, and for arches of the same depth, from leftmost left end to
rightmost left end.
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:代寫(xiě)COMP3020J encryptors and decryptors 程序&#160;
  • 下一篇:代寫(xiě)comp3211程序代做 &#160;IoT Framework&#160;
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁(yè)版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日本免费高清一区| 国产日产精品一区二区三区四区 | 男人天堂成人在线| 欧洲精品亚洲精品| 欧美在线免费观看| 欧美在线视频观看免费网站| 热久久精品免费视频| 亚洲欧美日韩不卡| 日韩中文字幕在线免费| 日本一区二区在线视频观看| 日韩欧美猛交xxxxx无码| 日本久久91av| 欧美在线一区二区视频| 欧美视频第一区| 欧美视频在线第一页| 红桃一区二区三区| 国产日韩成人内射视频| 97色在线观看免费视频| 久久久欧美一区二区| 久久久噜噜噜久久中文字免| 久久久久一本一区二区青青蜜月| 国产精品久久久久久久久久| 日本网站免费在线观看| 日本欧美国产在线| 欧美图片激情小说| 极品粉嫩国产18尤物| 国产一区二区黄色| 91精品一区二区| 久久精品日产第一区二区三区 | 久久国产精品99国产精| 美女啪啪无遮挡免费久久网站| 尤物国产精品| 日韩区国产区| 欧美亚洲精品一区二区| 国产一区二区高清视频| 131美女爱做视频| 日韩视频在线免费| 色综合视频网站| 日本在线播放不卡| 国内精品久久久久久久 | 黄色网zhan| 国产精自产拍久久久久久| 91av在线国产| 国产精品久久久久久久9999| 一区二区冒白浆视频| 日本精品视频在线播放| 国产亚洲黄色片| 91av在线网站| 国产精品海角社区在线观看| 午夜精品一区二区在线观看| 精品少妇一区二区三区在线| 久久免费视频网站| 国产精品成人av在线| 天天好比中文综合网| 精品一区二区日本| 国产二区不卡| 精品国产福利| 日韩精品一区中文字幕| 国产美女无遮挡网站| 日韩专区中文字幕| 亚洲欧美日韩另类精品一区二区三区 | 久久综合网hezyo| 日韩中文字幕三区| 国产精品一区二区在线观看| 久久天天躁狠狠躁夜夜爽蜜月| 亚洲国产欧美日韩| 国产美女精品视频免费观看| 国产精品爽爽爽爽爽爽在线观看 | 欧美另类在线播放| 青青青青在线视频| 91黄在线观看| 欧美激情久久久久| 欧美性大战久久久久| 69av视频在线播放| 欧美激情一区二区三区久久久| 欧美一区观看| 久久精品网站视频| 大波视频国产精品久久| 成人久久精品视频| 国产精品久久久久久久一区探花| 日产中文字幕在线精品一区| 国产精品一二三在线观看| 国产成人久久久精品一区 | 亚洲砖区区免费| 国产综合精品一区二区三区| 国产成人亚洲综合91精品| 亚洲一区国产精品| 国产精品一码二码三码在线| 精品国产一区二区三区久久久久久 | 久久国产天堂福利天堂| 狠狠综合久久av| 久操手机在线视频| 日本久久91av| 久久精品国产sm调教网站演员| 五月天色婷婷综合| 久久久综合香蕉尹人综合网| 午夜欧美性电影| 久久免费视频观看| 日本中文字幕一级片| 久久精品香蕉视频| 日韩av资源在线| 国产www免费| 日韩欧美亚洲在线| 久久精品国产一区二区电影| 欧美中文字幕视频| 日韩中文在线视频| 青青青在线视频播放| 日韩中文字幕网站| 欧美日韩亚洲一区二区三区在线观看| 国产成人免费91av在线| 韩国国内大量揄拍精品视频| 国产精品高潮粉嫩av| 国产一区玩具在线观看| 久久福利视频网| 国产欧美精品在线| 亚洲一区二区三区四区在线播放| 99久久精品无码一区二区毛片 | 国产精品久久久久不卡| 国产视频观看一区| 欧美日韩爱爱视频| 国产免费一区二区三区在线观看 | 精品亚洲第一| 久久99精品久久久久久琪琪| 高清视频一区| 视频在线99re| 国产精品手机在线| 国产精品综合不卡av| 亚洲高清123| 精品国产视频在线| 国产欧美久久久久| 日本a级片在线观看| 国产精品无码av无码| 国产午夜精品在线| 丁香六月激情网| 国产精品视频久久久久| 国产精品一区在线观看| 日本香蕉视频在线观看| 国产精品私拍pans大尺度在线| 红桃av在线播放| 亚洲人成人77777线观看| 菠萝蜜影院一区二区免费| 国产日韩欧美成人| 天堂av一区二区| 国产精品久久..4399| 久久免费福利视频| 国产午夜大地久久| 痴汉一区二区三区| 久久躁狠狠躁夜夜爽| 久久久在线观看| 国产在线观看不卡| 日韩av123| 久久久久久国产精品久久| 久久久噜噜噜久久久| 国产伦精品一区二区三毛| 日本免费高清一区二区| 欧美激情第1页| 国产精品无码一区二区在线| 国产精品99蜜臀久久不卡二区| 国内精品一区二区| 日韩欧美精品久久| 亚洲一区二区三区精品在线观看| 日韩中文在线中文网三级| 91精品国产综合久久香蕉| 国模精品娜娜一二三区| 青青视频在线播放| 无码中文字幕色专区| 欧美日韩成人在线播放| 久久人人爽人人爽爽久久| 7777精品伊久久久大香线蕉语言| 精品一区国产| 欧美影视一区二区| 欧美一级片中文字幕| 亚洲一区二区三区精品动漫| 欧美激情视频网址| 国产精品二区三区四区| 日韩视频第一页| 久久亚洲国产精品日日av夜夜| 成人精品久久久| 国产中文欧美精品| 欧美日韩成人一区二区三区| 日本三级中文字幕在线观看| 99在线观看| 欧美激情久久久久| 国产一区深夜福利| 日韩av一区二区三区在线| 国产精品1区2区在线观看| 伊人久久大香线蕉精品| 日本三级韩国三级久久| 精品视频第一区| 国产成人精品免费视频大全最热| 国产精品免费一区二区三区 | 不卡一卡2卡3卡4卡精品在| 久久久久久久色| 国产不卡一区二区视频| 国产午夜福利视频在线观看| 亚洲国产精品www| 欧美中文字幕视频| 久久中国妇女中文字幕| 久久中文字幕国产| 日日橹狠狠爱欧美超碰|