Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sampling-Based Abstractions
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thom Badings
Sampling-Based Abstractions
Commits
7eec3e72
Commit
7eec3e72
authored
2 years ago
by
Thom Badings
Browse files
Options
Downloads
Patches
Plain Diff
removed any hardcoded arguments
parent
a98f3b89
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Merged
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
RunFile.py
+0
-11
0 additions, 11 deletions
RunFile.py
core/cvx_opt.py
+32
-20
32 additions, 20 deletions
core/cvx_opt.py
core/spec_definitions.py
+5
-2
5 additions, 2 deletions
core/spec_definitions.py
with
37 additions
and
33 deletions
RunFile.py
+
0
−
11
View file @
7eec3e72
...
...
@@ -45,17 +45,6 @@ print('Base directory:', base_dir)
#-----------------------------------------------------------------------------
args
=
parse_arguments
()
#args.model = 'anaesthesia_delivery'
# args.drug_partition = [10,10,10]
#args.bld_par_uncertainty = True
#args.prism_java_memory = 32
args
.
model
=
'
drone
'
args
.
drone_spring
=
True
args
.
iterations
=
1
args
.
partition_plot
=
True
args
.
drone_mc_iter
=
20
args
.
drone_mc_step
=
1
with
open
(
os
.
path
.
join
(
base_dir
,
'
path_to_prism.txt
'
))
as
f
:
args
.
prism_folder
=
str
(
f
.
readlines
()[
0
])
...
...
This diff is collapsed.
Click to expand it.
core/cvx_opt.py
+
32
−
20
View file @
7eec3e72
...
...
@@ -53,12 +53,18 @@ class Controller(object):
self
.
error_neg
.
value
=
error
[:,
0
]
self
.
error_pos
.
value
=
error
[:,
1
]
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
ECOS
'
)
if
self
.
prob
.
status
==
'
infeasible
'
:
try
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
ECOS
'
)
if
self
.
prob
.
status
==
'
infeasible
'
:
return
False
,
None
,
None
else
:
return
True
,
self
.
x_plus
.
value
,
self
.
u
.
value
except
:
# Throw an exception is CVXPY solver failed
print
(
'
-- Warning: Could not solve LP; skip this action
'
)
return
False
,
None
,
None
else
:
return
True
,
self
.
x_plus
.
value
,
self
.
u
.
value
...
...
@@ -91,18 +97,24 @@ class LP_vertices_contained(object):
self
.
P_vertices
.
value
=
vertices
if
self
.
solver
==
'
GUROBI
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
GUROBI
'
)
elif
self
.
solver
==
'
ECOS
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
ECOS
'
)
elif
self
.
solver
==
'
OSQP
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
OSQP
'
,
eps_abs
=
1e-4
,
eps_rel
=
1e-4
)
elif
self
.
solver
==
'
SCS
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
SCS
'
)
else
:
self
.
prob
.
solve
(
warm_start
=
True
)
if
self
.
prob
.
status
!=
"
infeasible
"
:
return
True
else
:
return
False
\ No newline at end of file
try
:
if
self
.
solver
==
'
GUROBI
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
GUROBI
'
)
elif
self
.
solver
==
'
ECOS
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
ECOS
'
)
elif
self
.
solver
==
'
OSQP
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
OSQP
'
,
eps_abs
=
1e-4
,
eps_rel
=
1e-4
)
elif
self
.
solver
==
'
SCS
'
:
self
.
prob
.
solve
(
warm_start
=
True
,
solver
=
'
SCS
'
)
else
:
self
.
prob
.
solve
(
warm_start
=
True
)
if
self
.
prob
.
status
!=
"
infeasible
"
:
return
True
else
:
return
False
except
:
# Throw an exception is CVXPY solver failed
print
(
'
-- Warning: Could not solve LP; skip this state
'
)
return
False
\ No newline at end of file
This diff is collapsed.
Click to expand it.
core/spec_definitions.py
+
5
−
2
View file @
7eec3e72
...
...
@@ -188,8 +188,11 @@ class anaesthesia_delivery_spec(master.spec_master):
width
=
self
.
partition
[
'
boundary
'
]
@
np
.
array
([
-
1
,
1
])
/
self
.
partition
[
'
number
'
]
# Actions per dimension (if 'auto', equal to nr of regions)
self
.
targets
[
'
boundary
'
]
=
'
auto
'
#self.partition['boundary']
self
.
targets
[
'
number
'
]
=
'
auto
'
#self.partition['number']
self
.
targets
[
'
boundary
'
]
=
self
.
partition
[
'
boundary
'
]
self
.
targets
[
'
boundary
'
][:,
0
]
=
self
.
targets
[
'
boundary
'
][:,
0
]
+
width
self
.
targets
[
'
boundary
'
][:,
1
]
=
self
.
targets
[
'
boundary
'
][:,
1
]
-
width
self
.
targets
[
'
number
'
]
=
list
(
np
.
array
(
self
.
partition
[
'
number
'
])
-
2
)
self
.
goal
=
[
np
.
array
([[
4
,
6
],
[
0
,
10
],
[
0
,
10
]])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment