-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (33 loc) · 1.29 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
44
45
46
SHELL := /bin/bash
CONFIG_FILE = config.ini
# Get the variable from a given section in the configuration file
define get_variable
$(subst /,\,$(shell powershell.exe -Command "Get-Content $(CONFIG_FILE) | ForEach-Object { if ($$_ -match '\[$(1)\]') { $$section = $$true } elseif ($$section -and $$_ -match '^$(2)=([^;]+)') { $$matches[1].Trim() } }"))
endef
# Get the filename from a path
define get_filename
$(shell powershell.exe -NoProfile -Command "Split-Path '$1' -Leaf")
endef
# SUMO_PATH := $(call get_variable,dir,SUMO)
# CALIBRATORS_FILENAME := $(call get_filename, $(call get_variable,sumo,CALIBRATORS))
# CALIBRATORS_FILE = $(SUMO_PATH)\$(CALIBRATORS_FILENAME)
NODES_PATH := $(call get_variable,dir,NODES)
NODE_ARTICLE_FILENAME := $(call get_filename, $(call get_variable,nodes,NODE_ARTICLE))
NODE_ARTICLE_FILE = $(NODES_PATH)\$(NODE_ARTICLE_FILENAME)
.PHONY: all
all: prepare variables solve run
# TODO: Run the netconvert command on all node networks
prepare:
netconvert -s $(NODE_ARTICLE_FILE) -o $(NODE_ARTICLE_FILE) --remove-edges.isolated true
@python -m src.prepare
variables:
@python -m src.variables
solve:
@python -m src.solver
run:
@python -m src.digital_twin
results:
@python -m src.results
clean:
@PowerShell -Command "Write-Output 'Removing files...'"
# del $(CALIBRATORS_FILE)