voidism / 2019_CAD_Contest_ProblemE-testcase-visualizer

Testcase generator and visualizer and verification for your 2019 CAD Contest Problem E

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2019 CAD Contest ProblemE testcase & visualizer

Requirements

  • python3
  • tkinter

Usage:

Generate manual test case

python3 canvas.py [write_file_name]

會跳出一個空白視窗

  1. 接著按"m",開始畫M1的polygons
  • 在想要的位置用滑鼠點,畫polygon,可以畫不止一個

  • 如果剩兩條線可以連回起點,按"e"可以自動連線

  • 如果有三個點在同一條線上面的狀況,等等他會自己去掉

  1. 畫好了接著按"c"開始畫C1的polygons,可以畫不止一個
  2. 重複2. 3. 直到畫完直接關掉視窗,檔案就會寫入了

註:不能剩最後一步才按e,可能會生出這種瑕疵(左下角那裡):

例如畫四方形,點到第三個點就要按e了,不能四個都點完才按。

Visualize input/output file pairs

python3 draw_tk.py sample.in sample.out [window size(建議1000)]
  1. 一直按"r",一開始會把Merge跟Clip依序加入圖中,Merge是紅色Clip是綠色,M跟C都加完,會開始疊sample.out裡面最後split完的rectangles,要提前結束的話按"e"。

Random generate test case

  • rectangle test case only
  • Merge Clip 交替
  • 如果想讓測資的長寬範圍大一點,可以調第90行這邊的height跟width,目前只有設1000/600。
python random_case.py [output_file_name] [# of pairs of Merge and Clip] [# of rectangles in a Merge or Clip]

Verify by boolean mask

  • don't use this program to verify files that are over size (e.g. over 1000000 in window size), it will need large memory.
python verify.py [input_file_name] [output_file_name] [window size of testcase (max width of height)]

Random testing

  • ./myPolygon is needed in the same directory.
  • it will save the error case automatically for you to debug!
  • the error case and error output will be named as errorcase.in.*, errorcase.out.*.
bash run_test.sh [# of random testcase] [# of pairs of Merge and Clip in each testcase] [# of rectangles in a Merge or Clip]

2019 CAD Contest Link: http://iccad-contest.org/2019/tw/problems.html

About

Testcase generator and visualizer and verification for your 2019 CAD Contest Problem E


Languages

Language:Python 92.7%Language:Shell 7.3%