Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
synthesis-exp
compositional
Commits
8c9addf7
Commit
8c9addf7
authored
2 months ago
by
Sebastian Felgueras
Browse files
Options
Download
Email Patches
Plain Diff
added multiple sensers
parent
cffd1040
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
21 deletions
+27
-21
.gitignore
.gitignore
+2
-1
.vscode/launch.json
.vscode/launch.json
+1
-1
analisis/pages/Plant graph.py
analisis/pages/Plant graph.py
+4
-3
mtsa/mtsa.jar
mtsa/mtsa.jar
+0
-0
runner.py
runner.py
+20
-16
No files found.
.gitignore
View file @
8c9addf7
...
...
@@ -3,4 +3,5 @@ a.csv
__pycache__
.venv
.vscode
miscResults
\ No newline at end of file
miscResults
sensedPlants
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.vscode/launch.json
View file @
8c9addf7
...
...
@@ -18,7 +18,7 @@
"request"
:
"launch"
,
"program"
:
"${file}"
,
"console"
:
"integratedTerminal"
,
"args"
:
[
"--
timeout"
,
"2"
,
"--
cases"
,
"casos/casos
Several
Variable
s/
"
,
"--
kValues"
,
"2"
,
"4
"
]
"args"
:
[
"--cases"
,
"casos/casos
One
Variable"
,
"--
generatePlant
"
]
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
analisis/pages/Plant graph.py
View file @
8c9addf7
...
...
@@ -8,12 +8,13 @@ def listdir(p):
return
[
p
.
joinpath
(
x
)
for
x
in
os
.
listdir
(
p
)]
base
=
pathlib
.
Path
(
__file__
).
parent
.
parent
results_misc
=
base
.
parent
.
joinpath
(
"miscResults"
)
carpetas
=
listdir
(
results_misc
)
results_misc
=
base
.
parent
.
joinpath
(
"sensedPlants"
)
plant_sensors
=
listdir
(
results_misc
)
sensor
=
results_misc
.
joinpath
(
st
.
selectbox
(
"Plant sensor:"
,
sorted
([
p
.
name
for
p
in
plant_sensors
])))
@
st
.
fragment
def
t1
():
carpeta
=
results_misc
.
joinpath
(
st
.
selectbox
(
"Folder"
,
sorted
([
c
.
name
for
c
in
carpetas
])))
carpeta
=
sensor
.
joinpath
(
st
.
selectbox
(
"Folder"
,
sorted
([
c
.
name
for
c
in
listdir
(
sensor
)
])))
archivos
=
listdir
(
carpeta
)
familia
=
st
.
selectbox
(
"Family"
,
sorted
(
set
(
map
(
lambda
x
:
x
.
stem
[:
2
],
archivos
))))
problema
=
carpeta
.
joinpath
(
st
.
selectbox
(
"Problem"
,
sorted
([
p
.
name
for
p
in
archivos
if
p
.
stem
[:
2
]
==
familia
])))
...
...
This diff is collapsed.
Click to expand it.
mtsa/mtsa.jar
View file @
8c9addf7
No preview for this file type
This diff is collapsed.
Click to expand it.
runner.py
View file @
8c9addf7
...
...
@@ -49,23 +49,27 @@ def run_with_another_engine(engine="spectraEngine"):
def
generate_plant_graph
():
destinationFolder
=
base
.
joinpath
(
"miscResults/"
,
cases
.
name
)
try
:
destinationFolder
.
mkdir
(
parents
=
True
)
except
:
print
(
"Failed to create the destination folder"
)
destinationFolder
=
base
.
joinpath
(
"sensedPlants/"
)
plant_sensers
=
subprocess
.
run
([
"java"
,
"-Xmx8g"
,
"-classpath"
,
jarPath
,
"ltsa.ui.LTSABatch"
,
"--listPlantSensers"
],
capture_output
=
True
,
text
=
True
).
stdout
.
split
()
print
(
f
"Saving to folder at
{
destinationFolder
}
"
)
for
folder
in
tqdm
(
os
.
listdir
(
cases
),
desc
=
"Problem families"
):
problem_family
=
folder
folder
=
cases
.
joinpath
(
folder
)
problems
=
[
folder
.
joinpath
(
x
)
for
x
in
os
.
listdir
(
folder
)]
for
problem
in
tqdm
(
problems
,
leave
=
False
,
desc
=
f
"Problems in
{
problem_family
}
"
):
if
problem
.
suffix
==
".fsp"
or
problem
.
suffix
==
".lts"
:
out_base
=
str
(
destinationFolder
.
joinpath
(
problem
.
stem
))
subprocess
.
run
([
"java"
,
"-Xmx8g"
,
"-classpath"
,
jarPath
,
"ltsa.ui.LTSABatch"
,
"-i"
,
problem
,
"-c"
,
args
.
controllerType
,
"--sensePlantArchitecture"
,
f
"
{
out_base
}
.txt"
],
stdin
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
for
senser
in
tqdm
(
plant_sensers
,
desc
=
"Sensers processed"
):
out_folder
=
destinationFolder
.
joinpath
(
senser
,
cases
.
name
)
try
:
out_folder
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
except
:
print
(
"Failed to create the destination folder"
)
for
folder
in
tqdm
(
os
.
listdir
(
cases
),
desc
=
"Problem families"
,
leave
=
False
):
problem_family
=
folder
folder
=
cases
.
joinpath
(
folder
)
problems
=
[
folder
.
joinpath
(
x
)
for
x
in
os
.
listdir
(
folder
)]
for
problem
in
tqdm
(
problems
,
leave
=
False
,
desc
=
f
"Problems in
{
problem_family
}
"
):
if
problem
.
suffix
==
".fsp"
or
problem
.
suffix
==
".lts"
:
out_base
=
str
(
out_folder
.
joinpath
(
problem
.
stem
))
subprocess
.
run
([
"java"
,
"-Xmx8g"
,
"-classpath"
,
jarPath
,
"ltsa.ui.LTSABatch"
,
"-i"
,
problem
,
"-c"
,
args
.
controllerType
,
"--sensePlantArchitecture"
,
f
"
{
out_base
}
.txt"
,
"--plantSenser"
,
senser
],
stdin
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment