feup-plog

所属分类:其他
开发工具:Prolog
文件大小:0KB
下载次数:0
上传日期:2018-01-29 03:08:29
上 传 者sh-1993
说明:  大学学科-逻辑编程(Programa o em Lógica)-LYNGK棋盘游戏+约束满足问题,
(University Subject - Logic Programming (Programa o em Lógica) - LYNGK board game + Constraint Satisfaction Problem,)

文件列表:
.editorconfig (148, 2018-01-28)
classes/ (0, 2018-01-28)
classes/aula7/ (0, 2018-01-28)
classes/aula7/10.pl (735, 2018-01-28)
classes/aula7/5.pl (2374, 2018-01-28)
classes/plr/ (0, 2018-01-28)
classes/plr/1.pl (608, 2018-01-28)
classes/plr/4.pl (521, 2018-01-28)
classes/plr/7.pl (563, 2018-01-28)
classes/plr/plop2.pl (614, 2018-01-28)
classes/plr/pls5.pl (2626, 2018-01-28)
classes/plr/tasks_extra.pl (653, 2018-01-28)
exams/ (0, 2018-01-28)
exams/2006_R/ (0, 2018-01-28)
exams/2006_R/Exame_Recurso_Fev2008.pdf (97184, 2018-01-28)
exams/2006_R/plr.pl (2809, 2018-01-28)
exams/2007_N/ (0, 2018-01-28)
exams/2007_N/Exame_Normal_Jan2008.pdf (84324, 2018-01-28)
exams/2007_N/plr.pl (4345, 2018-01-28)
exams/2009_N/ (0, 2018-01-28)
exams/2009_N/Exame_PL_2009_10_Normal.pdf (87700, 2018-01-28)
exams/2009_N/Exame_PL_2009_10_Normal_Sol.pdf (149340, 2018-01-28)
exams/2009_N/map_coloring.jpg (99690, 2018-01-28)
exams/2009_N/map_coloring.pl (3102, 2018-01-28)
exams/2009_N/plr.pl (1580, 2018-01-28)
exams/2011_N/ (0, 2018-01-28)
exams/2011_N/Exame_PL_2011_11_Normal_G1_Sol.pdf (18620, 2018-01-28)
exams/2011_N/Exame_PL_2011_11_Normal_G2_Sol.pdf (37482, 2018-01-28)
exams/2011_N/exame_PLOG_1011.pdf (74987, 2018-01-28)
exams/2011_N/plr.pl (2567, 2018-01-28)
exams/2012_N/ (0, 2018-01-28)
exams/2012_N/PLOG_Exame_EN_20120117.pdf (316841, 2018-01-28)
exams/2012_N/plr.pl (3328, 2018-01-28)
exams/2012_R/ (0, 2018-01-28)
exams/2012_R/PLOG_Exame_ER_20120210.pdf (56946, 2018-01-28)
exams/2012_R/plr.pl (2469, 2018-01-28)
exams/2013_N/ (0, 2018-01-28)
exams/2013_N/EN_20130110.pdf (225377, 2018-01-28)
... ...

# feup-plog Univeristy Subject - Logic Programming (Programao em Lógica) [Faculty of Engeneering of University of Porto](https://sigarra.up.pt/feup/en/WEB_PAGE.INICIAL) 2017/2018 With the colaboration of [Daniel Silva](https://github.com/Dannyps) Logic Programming in PROLOG ### Check the [solved Class Exercises](https://github.com/msramalho/feup-plog/tree/master/classes) and [solved Exams and Tests](https://github.com/msramalho/feup-plog/tree/master/exams) ## [TP1](https://github.com/msramalho/feup-plog/tree/master/tp1) - LYNGK Board Game - [Report](https://github.com/msramalho/feup-plog/blob/master/tp1/report.pdf)


## [TP2](https://github.com/msramalho/feup-plog/tree/master/tp2)- Teacher Hour Allocation - Constraints (Finite Domain) - [Paper](https://github.com/msramalho/feup-plog/blob/master/tp2/paper.pdf) We developed a PROLOG file ([main.pl](https://github.com/msramalho/feup-plog/blob/master/tp2/src/main.pl)) that can be run to find a solution for the problem specified in [data.pl](https://github.com/msramalho/feup-plog/blob/master/tp2/src/data.pl) using sicstus constraint engine for Finite Domains (`:- use_module(library(clpfd)).`). ## interface.py This file, essentially, does everything. It generates json versions of problems with solution, converts them to Prolog to feed our open-mouthed slow-eater solver, and executes them. It is also able to output the results to a *.csv* file for later interpretation. To see everything it can do, call `python interface.py -h`: ``` usage: interface.py [-h] [-g] [-p] [-e] [-tt] [-ht] [-nr] [-nf] [-md] [-jf] [-pf] [-cf] [-r] [-d] [-t] [-ra] Python generator, parser, executer and analyser for problems concerning the teacher hours assignment optional arguments: -h, --help show this help message and exit actions: -g, --generate Generate a JSON file (-jf) with a solvale problem -p, --parse Parse from a JSON file into a Prolog file(-jf to -pf) -e, --execute Execute the main.pl file with a custom Prolog data file (-pf, -cf) -tt, --test Run all the json files inside data/ -ht, --hardcode-test Run the hardcoded tests generation arguments: -nr , --number-rounds Number of rounds for the generator (default is 1) -nf , --number-fields Number of fields for the generator (default is 1) -md , --max-diff Max Diff value for the generator (default is 0) custom filenames: -jf , --json-file The name of the json file to be used (generation, parsing) -pf , --prolog-file The name of the prolog file to be used (parsing, execution) -cf , --csv-file The name of the csv file to save the results (not specified = no output) behaviour customization: -r, --remove Remove the generated files -d, --debug Run the prolog code in debug mode (only for executing) -t, --tabled Makes the output form JSON to Prolog be tabled for easy reading -ra, --randomize randomize the number of effective hours, instead of using all available (for generator) ``` Some example of cool commands are: - `python interface.py -g -jf data/example.json` (generates a problem with the default values in JSON) - `python interface.py -g -jf data/example.json -nr 10` (same but using 10 rounds instead of 1, much harder for the solver) - `python interface.py -p -jf data/example.json -pf src/data_example.pl` (converts JSON to the predicates used by the solver) if -pf is not specified, src/data.pl is used - `python interface.py -e -pf src/data_exemple.pl -d -cf temp.csv` (executs the solver with the given data file, in debuf mode(-d) and writes the results (backtracks, heurisric, walltime, ...) to temp.csv and also on the console) - `python interface.py -pge -jf data/everything.json -pf src/data_exemple.pl -cf temp.csv -d -nr 10 -nf 5 -md 4` (generates, parses and executes a new problem with 10 rounds, 5 fields of expertise and a maxDiff of 4)

近期下载者

相关文件


收藏者