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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫COMP9021object-oriented Python  程序
代寫COMP9021object-oriented Python  程序

時間:2025-11-08  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



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.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機打開當前頁
  • 上一篇:代寫COMP3020J encryptors and decryptors 程序&#160;
  • 下一篇:代寫comp3211程序代做 &#160;IoT Framework&#160;
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产精品裸体瑜伽视频| 国产成人福利视频| 91久久精品在线| 国产精品九九久久久久久久| 日韩中文字幕组| 国产精品伊人日日| 九九九九九精品| 无码内射中文字幕岛国片| 国产欧美一区二区三区四区 | 国产日本欧美在线| 久久精品国产电影| 日本三级久久久| 国产精品aaa| 亚洲熟妇无码一区二区三区导航| 国产一区喷水| 国产精品麻豆va在线播放| 欧美少妇一区| 国产成人精品视频免费看| 亚州欧美日韩中文视频| 不卡一卡2卡3卡4卡精品在| 精品乱色一区二区中文字幕| 美媛馆国产精品一区二区| 久久久国产精品免费| 欧美连裤袜在线视频| 久久久精品久久久久| 欧美在线观看日本一区| 色噜噜亚洲精品中文字幕| 日本精品视频在线观看| 久久久中文字幕| 日韩av成人在线观看| 91精品国产91久久久久福利| 亚洲欧洲日本国产| 久久伊人一区| 天天成人综合网| 国产黄色片免费在线观看| 国产精品激情av在线播放| 国产亚洲欧美一区二区三区| 欧美日本啪啪无遮挡网站| 99视频精品全部免费看| 日韩在线第一区| 国产成人拍精品视频午夜网站| 狠狠噜天天噜日日噜| 精品麻豆av| 99在线观看视频网站| 日本在线观看a| 国产精品视频免费一区| 美女精品国产| 伊人久久大香线蕉精品| 成人免费在线小视频| 色综合久久中文字幕综合网小说| 国产乱码精品一区二区三区卡 | 欧美日韩视频免费| 国产精品第一视频| 国产欧美一区二区三区在线看| 久久久久久国产精品美女| 精品国产福利| 99久久伊人精品影院| 亚洲v日韩v综合v精品v| 97精品免费视频| 国产精品观看在线亚洲人成网| 欧美日韩一道本| 精品国产_亚洲人成在线| 国产伦精品一区二区三区视频孕妇| 久久成人综合视频| 99超碰麻豆| 日本人成精品视频在线| 久久久精品久久久| 国产视频一区二区三区在线播放| 亚洲精品免费av| 日韩中文字幕在线视频| 国内精品中文字幕| 中文字幕av导航| 国产精华一区| 欧美另类一区| 精品免费国产| 91国内揄拍国内精品对白| 日韩欧美99| 欧美成人免费在线观看| 成人精品视频一区二区| 青青青国产精品一区二区| 久久综合亚洲社区| 81精品国产乱码久久久久久| 青青草视频在线视频| 久久这里有精品视频| 国产精品99蜜臀久久不卡二区| 欧美综合在线第二页| 欧美精品激情视频| 久久超碰亚洲| 粉嫩av免费一区二区三区| 亚洲精品免费一区二区三区| 国产成人免费av电影| 国产精品一区二区三| 日韩女优在线播放| 色综合色综合网色综合| 久久九九视频| 国产一区二区三区精彩视频| 欧美一区二区色| 国产精品嫩草影院久久久| 99视频日韩| 欧美少妇在线观看| 视频一区二区视频| 久久国产精品影片| 久久国产精品久久| 国产伦精品一区二区三区视频免费| 亚欧洲精品在线视频免费观看| 久久九九全国免费精品观看| 91精品国产91久久久久久| 免费h精品视频在线播放| 天天干天天色天天爽| 欧美精品做受xxx性少妇| 久久久久在线观看| 97精品视频在线播放| 欧美性大战久久久久| 日本精品在线视频| 亚洲熟妇无码一区二区三区导航| 国产精品久久久久久久天堂第1集 国产精品久久久久久久午夜 | 国产精品福利在线观看网址| 97久久天天综合色天天综合色hd| 欧美日韩视频免费在线观看| 日本女人高潮视频| 午夜精品久久久久久久99热浪潮 | 国产成人一区二区三区别| 国产美女主播一区| 国严精品久久久久久亚洲影视 | 国产自产精品| 欧美精品一区二区三区三州 | 国产激情综合五月久久| 国产九九精品视频| 国产中文字幕视频在线观看| 欧美主播一区二区三区美女 久久精品人| 一区二区传媒有限公司| 久精品免费视频| 国产精品久久久久久久久久久久久久 | 黄色片一级视频| 秋霞成人午夜鲁丝一区二区三区 | 超在线视频97| 国产精品免费一区二区| 久久久久久久久久久国产| 97国产一区二区精品久久呦| 国产一区精品在线| 欧美亚洲另类在线一区二区三区| 午夜一区二区三视频在线观看| 亚洲一区影院| 亚洲不卡中文字幕无码| 亚洲在线观看视频网站| 自拍视频一区二区三区| 在线视频不卡一区二区三区| 欧美日韩福利视频| 精品久久久久久综合日本| 国产精品激情av在线播放| 久久久久久久久久久久久久一区 | 视频一区二区三区免费观看| 亚洲一区二区久久久久久| 中文字幕99| 亚洲一区二区在线播放| 亚洲字幕一区二区| 亚洲欧洲免费无码| 欧美一区二区三区图| 欧美激情视频一区二区| 国产精品嫩草影院一区二区| 国产精品都在这里| 久久久国产影院| 国产精品国产一区二区| 国产精品久久久91| 久久综合亚洲社区| 精品国产一区二区三区日日嗨| 欧美情侣性视频| 亚洲v日韩v综合v精品v| 日本不卡一二三区| 欧美激情 国产精品| 欧美激情亚洲天堂| 国产视频一区二区不卡| 国产伦一区二区三区色一情| 99在线高清视频在线播放| 久久综合色视频| 日韩视频免费在线| 久热精品视频在线观看一区| 一区二区三区四区在线视频| 欧美激情中文网| 亚洲精品永久www嫩草| 日韩wuma| 国内精品久久久久久影视8| 蜜桃麻豆www久久国产精品| 欧洲成人一区二区| 国产精品亚洲美女av网站| 久久免费观看视频| 国产精品区一区| 在线精品日韩| 欧美一级片久久久久久久| 欧美精品二区三区四区免费看视频 | 国产一区二区三区免费不卡| 国产欧美日韩视频一区二区三区 | 国产精品久久久久久超碰 | 久久久久久国产精品美女| 日韩在线第一区| 精品欧美日韩| 99在线看视频| 久久久久北条麻妃免费看| 美女扒开尿口让男人操亚洲视频网站| 自拍视频一区二区三区|