Makefile 3.51 KB
DISTS = {1000..8000..1000}
CHOCO_HOME = $(HOME)/IdeaProjects/git/bioecosys/BIOECOSYS-Prototype
CHOCO_HOME = .
CHOCO = $(CHOCO_HOME)/$(wildcard choco-solver-4.*-jar-with-dependencies.jar)
CLASSES = $(shell find -name \*.class | sed -e 's;[^/]*$$;;' | sort -u | tr '\n' :)
JFLAGS = -cp $(CHOCO):$(CLASSES)

all: make

make: 	
	(time java $(JFLAGS) Main 50 res 0 0 Paredes ) &>> Times/results;
	python3 create_map_file.py;
	python3 Exports/mapsToFolder.py 1;
	
	
	(time java $(JFLAGS) Main 96 res 0 0 Penafiel ) &>> Times/results;
	python3 create_map_file.py;
	python3 Exports/mapsToFolder.py 4;
	
	(time java $(JFLAGS) Main 50 res 0 0 PaivaNorte ) &>> Times/results;
	python3 create_map_file.py;
	python3 Exports/mapsToFolder.py 3;


	(time java $(JFLAGS) Main 81 res 0 0 PaivaSul ) &>> Times/results;
	python3 create_map_file.py;
	python3 Exports/mapsToFolder.py 2;
	

paredes:
	(time java $(JFLAGS) Main 50 res 0 0 Paredes ) &>> Times/results;\
		cat Times/results | tr '\n' ',' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/\t//g' -e 's/real//g' -e 's/user//g' -e 's/sys//g'| sed -e 's/.$$//' -e '0,/,/{s/,//}' > Times/result;\
		cat Times/result | sed -z -e 's/,/\./2' -e 's/,/\./3' -e 's/,/\./4' > Times/ii.txt;\
	cat Times/result | sed -z -e 's/,/\./2' -e 's/,/\./3' -e 's/,/\./4' > Times/ii.txt;\
		echo Paredes,50,$$I, > Times/i.txt;\
	paste --delimiter='' Times/i.txt Times/ii.txt > Times/iii.txt;\
	cat Times/iii.txt &>> Times/regions.csv;
	python3 create_map_file.py;
	python3 Exports/mapsToFolder.py 1;

penafiel:
	java $(JFLAGS) Main 96 res 0 0 Penafiel
	python3 create_map_file.py
	python3 Exports/mapsToFolder.py 4

paivasul:
	java $(JFLAGS) Main 80 res 0 0 PaivaSul &>> Times/results
	python3 create_map_file.py
	python3 Exports/mapsToFolder.py 2

paivanorte:
	(time java $(JFLAGS) Main 50 res 0 0 PaivaNorte ) &>> Times/results;\
		cat Times/results | tr '\n' ',' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/\t//g' -e 's/real//g' -e 's/user//g' -e 's/sys//g'| sed -e 's/.$$//' -e '0,/,/{s/,//}' > Times/result;\
		cat Times/result | sed -z -e 's/,/\./2' -e 's/,/\./3' -e 's/,/\./4' > Times/ii.txt;\
	cat Times/result | sed -z -e 's/,/\./2' -e 's/,/\./3' -e 's/,/\./4' > Times/ii.txt;\
		echo PaivaNorte,50,$$I, > Times/i.txt;\
	paste --delimiter='' Times/i.txt Times/ii.txt > Times/iii.txt;\
	cat Times/iii.txt &>> Times/regions.csv;
	python3 create_map_file.py;
	python3 Exports/mapsToFolder.py 3;
	
yields:
	java $(JFLAGS) Main 50 res 0 0 Paredes  &>> Yields/yields;
	
	java $(JFLAGS) Main 96 res 0 0 Penafiel &>> Yields/yields;

	java $(JFLAGS) Main 50 res 0 0 PaivaNorte &>> Yields/yields;

	java $(JFLAGS) Main 81 res 0 0 PaivaSul &>> Yields/yields;
	
	
newyields: 
	for I in $(DISTS); do \
		java $(JFLAGS) Main 50 res 0 $$I &>> Yields/yields2;\
	done	
	
yield: 
	java $(JFLAGS) Main 50 res 0 5000 &>> Yields/yields2;
	
test:
	for I in $(DISTS); do \
		(time java $(JFLAGS) Main 50 res 0 $$I) &>> Times/results;\
		cat Times/results | tr '\n' ',' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/\t//g' -e 's/real//g' -e 's/user//g' -e 's/sys//g'| sed -e 's/.$$//' -e '0,/,/{s/,//}' > Times/result;\
		cat Times/result | sed -z -e 's/,/\./2' -e 's/,/\./3' -e 's/,/\./4' > Times/ii.txt;\
		echo Default,50,$$I, > Times/i.txt;\
		paste --delimiter='' Times/i.txt Times/ii.txt > Times/iii.txt;\
		cat Times/iii.txt &>> Times/times.csv;\
		rm -rf Times/results;\
		rm -rf Times/result;\
		rm -rf Times/i.txt;\
		rm -rf Times/ii.txt;\
		rm -rf Times/iii.txt;\
	done	
	cat Times/times.csv | cut -d ',' -f1,2,4,5 | sed -e 's/Limit//g' -e 's/\.//g' -e 's/s//g' -e 's/,/;/g' -e 's/m/,/g'  > Times/timesGraph.csv