-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (31 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
clean:
$(RM) scenarios/*.output.lp
$(RM) scenarios/*.graph.pdf
$(RM) -r .pytest_cache
docker-build:
docker build --no-cache -t sosac-reasoner .
DOCKER_RUN=docker run -v $(shell pwd):/app -p 80:80 sosac-reasoner
docker-run: # make docker-run CMD="make minimal.lp"
$(DOCKER_RUN) $(CMD)
# -----------------------------------------
GRAPH_GEN_RUN=clingo src/graphs.lp
SOSAC_INFERENCE_RUN=clingo src/engine.lp src/sosac_engine.lp src/kb/*.lp
%.lp:
$(MAKE) $*.output.lp $*.graph.pdf
%.output.lp:
$(SOSAC_INFERENCE_RUN) scenarios/$*.lp 0 -V0 --out-atomf=%s. | head -n 1 > scenarios/$*.output.lp
%.graph.pdf:
$(GRAPH_GEN_RUN) scenarios/$*.output.lp 0 --outf=2 | \
clingraph --out=render --type=digraph --dir scenarios/ --name-format='$*.graph'
run-example:
$(SOSAC_INFERENCE_RUN) examples/commonsense.lp -c time=night -c remove_device=sb01
test-unit:
pytest test/test_unit_sosa.py test/test_unit_kb.py
SIZE_FROM=1
SIZE_OFFSET=100
NUM_CASES=10
ITERATIONS=5
OUTPUT_FILE=docs/from$(SIZE_FROM)-offset$(SIZE_OFFSET)-$(NUM_CASES)cases$(ITERATIONS)times-evaluation.csv
run-eval: # make run-eval SIZE_FROM=1 SIZE_OFFSET=100 NUM_CASES=10 ITERATIONS=5
python3 src/eval_performance.py \
${SIZE_FROM} ${SIZE_OFFSET} ${NUM_CASES} ${ITERATIONS} ${OUTPUT_FILE}