Skip to content

Commit

Permalink
Merge pull request #220 from JuliaReach/schillic/relpath
Browse files Browse the repository at this point in the history
Replace `relpath` macro by `ReachabilityBase.current_path`
  • Loading branch information
schillic authored Jun 2, 2024
2 parents b3626b0 + 7342e9f commit e42c9d3
Show file tree
Hide file tree
Showing 56 changed files with 123 additions and 175 deletions.
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ name = "ReachabilityBenchmarks"
uuid = "a4785ef3-4c78-58ec-bbba-68644ee365c0"
version = "0.0.1"

[deps]
ReachabilityBase = "379f33d0-9447-4353-bd03-d664070e549f"

[compat]
ReachabilityBase = "0.2.5"
julia = "1.2"
2 changes: 1 addition & 1 deletion models/ARCH/AFF/Building/building.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using ReachabilityBenchmarks, Reachability, MathematicalSystems, SX,
# ==============================
# Load model
# ==============================
file = @relpath "SX/Building_more_decimals.xml"
file = @current_path "SX/Building_more_decimals.xml"
H = readsxmodel(file; ST=ConstrainedLinearControlContinuousSystem)

# ===================
Expand Down
8 changes: 4 additions & 4 deletions models/ARCH/AFF/Building/building_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ plot(res;
size=(1000, 1000))
plot_dashed_line!(4e-3)
plot_dashed_line!(5.1e-3)
savefig(@relpath "BLDF01_time_horizon_1.png")
savefig(@current_path "BLDF01_time_horizon_1.png")

plot(res;
tickfont=font(30, "Times"), guidefontsize=45,
Expand All @@ -61,7 +61,7 @@ plot(res;
size=(1000, 1000))
plot_dashed_line!(4e-3)
plot_dashed_line!(5.1e-3)
savefig(@relpath "BLDF01_time_horizon_20.png")
savefig(@current_path "BLDF01_time_horizon_20.png")

𝑂_BLDC01[:mode] = "reach"
𝑂_BLDC01[:plot_vars] = [0, 25]
Expand All @@ -78,7 +78,7 @@ plot(res;
size=(1000, 1000))
plot_dashed_line!(4e-3)
plot_dashed_line!(5.1e-3)
savefig(@relpath "BLDC01_time_horizon_1.png")
savefig(@current_path "BLDC01_time_horizon_1.png")

plot(res;
tickfont=font(30, "Times"), guidefontsize=45,
Expand All @@ -90,4 +90,4 @@ plot(res;
size=(1000, 1000))
plot_dashed_line!(4e-3)
plot_dashed_line!(5.1e-3)
savefig(@relpath "BLDC01_time_horizon_20.png")
savefig(@current_path "BLDC01_time_horizon_20.png")
4 changes: 2 additions & 2 deletions models/ARCH/AFF/Platooning/Platooning_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ plot(res;
bottom_margin=6mm, left_margin=2mm,
size=(1000, 1000))
plot_dashed_line!(-42.0)
savefig(@relpath "PLAD01_BND42.png")
savefig(@current_path "PLAD01_BND42.png")

options_PLAN01_UNB50[:mode] = "reach"
options_PLAN01_UNB50[:plot_vars] = [0, 1]
Expand All @@ -118,4 +118,4 @@ plot(res;
bottom_margin=6mm, left_margin=2mm,
size=(1000, 1000))
plot_dashed_line!(-50.0, time_horizon)
savefig(@relpath "PLAN01_UNB50.png")
savefig(@current_path "PLAN01_UNB50.png")
4 changes: 2 additions & 2 deletions models/ARCH/AFF/Rendezvous/SpacecraftRendezvous_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ plot(res;
xlims=(-1000.0, 0.0), ylims=(-500.0, 100.0),
bottom_margin=10mm, left_margin=10mm, top_margin=3mm,
size=(1000, 1000))
savefig(@relpath "SRNA01_SR02.png")
savefig(@current_path "SRNA01_SR02.png")

res = solve(SRA01, options, opC_dense, opD)
plot(res;
Expand All @@ -166,4 +166,4 @@ plot(res;
xlims=(-1000.0, 400.0), ylims=(-500.0, 100.0),
bottom_margin=10mm, left_margin=10mm, top_margin=3mm,
size=(1000, 1000))
savefig(@relpath "SRA01_SR02.png")
savefig(@current_path "SRA01_SR02.png")
2 changes: 1 addition & 1 deletion models/ARCH/AFF/SpaceStation/iss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using ReachabilityBenchmarks, MAT, Reachability, MathematicalSystems,
# ==============================
# Load model
# ==============================
file = matopen(@relpath "iss.mat")
file = matopen(@current_path "iss.mat")
A = sparse(read(file, "A"))
B = read(file, "B")
C = Matrix(read(file, "C")[3, :]')
Expand Down
4 changes: 2 additions & 2 deletions models/ARCH/AFF/SpaceStation/iss_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ plot(res;
size=(1000, 1000))
plot_dashed_lines!(0.0005)
plot_dashed_lines!(0.0007)
savefig(@relpath "ISSF01.png")
savefig(@current_path "ISSF01.png")

𝑂_ISS02[:mode] = "reach"
𝑂_ISS02[:projection_matrix] = projection_matrix
Expand All @@ -80,4 +80,4 @@ plot(res;
bottom_margin=6mm, left_margin=2mm, right_margin=2mm,
size=(1000, 1000))
plot_dashed_lines!(0.00017)
savefig(@relpath "ISSC01.png")
savefig(@current_path "ISSC01.png")
8 changes: 4 additions & 4 deletions models/ARCH/NLN/LaubLoomis/laubloomis_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ plot(sol_case_1;
size=(1000, 1000), linecolor="blue")

plot!(x -> x, x -> 4.5, 0.0, 20.0; line=2, color="red", linestyle=:dash, legend=nothing)
savefig(@relpath "laubloomis_case_1.png")
savefig(@current_path "laubloomis_case_1.png")

plot(sol_case_2;
tickfont=font(30, "Times"), guidefontsize=45,
Expand All @@ -114,7 +114,7 @@ plot(sol_case_2;
size=(1000, 1000), linecolor="blue")

plot!(x -> x, x -> 5.0, 0.0, 20.0; line=2, color="red", linestyle=:dash, legend=nothing)
savefig(@relpath "laubloomis_case_2.png")
savefig(@current_path "laubloomis_case_2.png")

plot(sol_case_3;
tickfont=font(30, "Times"), guidefontsize=45,
Expand All @@ -127,7 +127,7 @@ plot(sol_case_3;
size=(1000, 1000), linecolor="blue")

plot!(x -> x, x -> 5.0, 0.0, 20.0; line=2, color="red", linestyle=:dash, legend=nothing)
savefig(@relpath "laubloomis_case_3.png")
savefig(@current_path "laubloomis_case_3.png")

plot(sol_case_1; color="red")

Expand All @@ -145,4 +145,4 @@ plot!(sol_case_3; alpha=0.2,

plot!(x -> x, x -> 5.0, 0.0, 20.0; line=2, color="red", linestyle=:dash, legend=nothing)
plot!(x -> x, x -> 4.5, 0.0, 20.0; line=2, color="red", linestyle=:dash, legend=nothing)
savefig(@relpath "laubloomis_case_all.png")
savefig(@current_path "laubloomis_case_all.png")
2 changes: 1 addition & 1 deletion models/ARCH/NLN/Quadrotor/quadrotor_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ plot!(x -> x, x -> 0.98, 0.0, 5.0; line=2, color="red", linestyle=:dash, legend=
plot!(x -> x, x -> 1.02, 0.0, 5.0; line=2, color="red", linestyle=:dash, legend=nothing)
plot!(x -> x, x -> 0.9, 0.0, 5.0; line=2, color="red", linestyle=:dash, legend=nothing)

savefig(@relpath "quadrotor.png")
savefig(@current_path "quadrotor.png")
6 changes: 3 additions & 3 deletions models/ARCH/NLN/VanDerPol/vanderpol_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ plot(sol_1;
size=(1000, 1000), linecolor="red", color="red")

plot!(x -> x, x -> 2.75, -3.0, 3.0; line=2, color="red", linestyle=:dash, legend=nothing)
savefig(@relpath "vanderpol_case_1.png")
savefig(@current_path "vanderpol_case_1.png")

# --------------------------
# Case 2
Expand All @@ -114,7 +114,7 @@ for i in 1:nsplits_x
size=(1000, 1000), color="blue", linewidth=0.0, linecolor="blue", alpha=0.5)
end

savefig(plot_2, @relpath "vanderpol_case_2.png")
savefig(plot_2, @current_path "vanderpol_case_2.png")

# --------------------------
# Cases 1 and 2 overlapped
Expand Down Expand Up @@ -143,4 +143,4 @@ plot!(plot_all, sol_1; tickfont=font(30, "Times"), guidefontsize=45,

plot!(plot_all, x -> x, x -> 2.75, -2.5, 2.5; line=2, color="red", linestyle=:dash, legend=nothing)

savefig(plot_all, @relpath "vanderpol_case_all.png")
savefig(plot_all, @current_path "vanderpol_case_all.png")
2 changes: 1 addition & 1 deletion models/ARCH2020/AFF/Building/building.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using ReachabilityBenchmarks, ReachabilityAnalysis, MathematicalSystems, SX,
# ==============================
# Load model
# ==============================
file = @relpath "SpaceEx/Building_more_decimals.xml"
file = @current_path "SpaceEx/Building_more_decimals.xml"
H = readsxmodel(file; ST=ConstrainedLinearControlContinuousSystem)

# ===================
Expand Down
20 changes: 10 additions & 10 deletions models/ARCH2020/AFF/Building/building_benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ include("building_GLGM06.jl")

# # tune parameters
# tune!(SUITE)
#
#
# # run the benchmarks
# results = run(SUITE, verbose=false)
#
#
# # return the sample with the smallest time value in each test
# println("minimum: ", minimum(results))
#
#
# # return the median for each test
# println("median: ", median(results))

Expand Down Expand Up @@ -49,7 +49,7 @@ plot(res;
size=(1000, 1000))
plot_dashed_line!(4e-3)
plot_dashed_line!(5.1e-3)
savefig(@relpath "BLDF01_time_horizon_1.png")
savefig(@current_path "BLDF01_time_horizon_1.png")

# plot(res,
# vars=plot_vars,
Expand All @@ -62,10 +62,10 @@ savefig(@relpath "BLDF01_time_horizon_1.png")
# size=(1000, 1000))
# plot_dashed_line!(4e-3)
# plot_dashed_line!(5.1e-3)
# savefig(@relpath "BLDF01_time_horizon_20.png")
#
# savefig(@current_path "BLDF01_time_horizon_20.png")
#
# res = solve(build_CONST, algo=algo_dense, T=time_horizon)
#
#
# plot(res,
# vars=plot_vars,
# tickfont=font(30, "Times"), guidefontsize=45,
Expand All @@ -77,8 +77,8 @@ savefig(@relpath "BLDF01_time_horizon_1.png")
# size=(1000, 1000))
# plot_dashed_line!(4e-3)
# plot_dashed_line!(5.1e-3)
# savefig(@relpath "BLDC01_time_horizon_1.png")
#
# savefig(@current_path "BLDC01_time_horizon_1.png")
#
# plot(res,
# vars=plot_vars,
# tickfont=font(30, "Times"), guidefontsize=45,
Expand All @@ -90,4 +90,4 @@ savefig(@relpath "BLDF01_time_horizon_1.png")
# size=(1000, 1000))
# plot_dashed_line!(4e-3)
# plot_dashed_line!(5.1e-3)
# savefig(@relpath "BLDC01_time_horizon_20.png")
# savefig(@current_path "BLDC01_time_horizon_20.png")
4 changes: 2 additions & 2 deletions models/BouncingBall/bouncingBallNonlinear_run.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability,
TaylorIntegration, Plots

include(@relpath "bouncingBallNonlinear_model.jl")
include(@relpath "bouncingBallNonlinear_specifications.jl")
include(@current_path "bouncingBallNonlinear_model.jl")
include(@current_path "bouncingBallNonlinear_specifications.jl")

S = bouncingBallNonlinear_model()
X0, options = bouncingBallNonlinear_specification()
Expand Down
4 changes: 2 additions & 2 deletions models/Crane/crane_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "crane_model.jl")
include(@relpath "crane_specifications.jl")
include(@current_path "crane_model.jl")
include(@current_path "crane_specifications.jl")

S = crane_model()
X0, options = crane_specification()
Expand Down
4 changes: 2 additions & 2 deletions models/FiveDimSys/fiveDimSys_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "fiveDimSys_model.jl")
include(@relpath "fiveDimSys_specifications.jl")
include(@current_path "fiveDimSys_model.jl")
include(@current_path "fiveDimSys_specifications.jl")

S = fiveDimSys_model()
X0, options = fiveDimSys_specification()
Expand Down
4 changes: 2 additions & 2 deletions models/Helicopter/helicopter_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "helicopter_model.jl")
include(@relpath "helicopter_specifications.jl")
include(@current_path "helicopter_model.jl")
include(@current_path "helicopter_specifications.jl")

S = helicopter_model()
X0, options = helicopter_specification()
Expand Down
4 changes: 2 additions & 2 deletions models/LinearSwitching/linearSwitching_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# transitions: 5
#
# The model is taken from [1].
#
#
# [1] https://ths.rwth-aachen.de/research/projects/hypro/5-dimensional-switching-linear-system/
# ==============================================================================
using HybridSystems, MathematicalSystems, LazySets, SymEngine
Expand All @@ -24,7 +24,7 @@ function linearSwitching_model()
HA = GraphAutomaton(5)

# SpaceEx model
file = @relpath "SpaceEx/model.xml"
file = @current_path "SpaceEx/model.xml"
model = readsxmodel(file; raw_dict=true)
variables = convert.(Basic, [f.args[1].args[1] for f in model["flows"][1]])
inputs = [convert(Basic, :u)]
Expand Down
4 changes: 2 additions & 2 deletions models/LinearSwitching/linearSwitching_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "linearSwitching_model.jl")
include(@relpath "linearSwitching_specifications.jl")
include(@current_path "linearSwitching_model.jl")
include(@current_path "linearSwitching_specifications.jl")

S = linearSwitching_model()
X0, options = linearSwitching_specification()
Expand Down
4 changes: 2 additions & 2 deletions models/Lorenz/lorenz_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "lorenz_model.jl")
include(@relpath "lorenz_specifications.jl")
include(@current_path "lorenz_model.jl")
include(@current_path "lorenz_specifications.jl")

S = lorenz_model()
X0, options = lorenz_specification()
Expand Down
4 changes: 2 additions & 2 deletions models/Projectile/projectile_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "projectile_model.jl")
include(@relpath "projectile_specifications.jl")
include(@current_path "projectile_model.jl")
include(@current_path "projectile_specifications.jl")

S = projectile_model()
X0, options = projectile_specification()
Expand Down
2 changes: 1 addition & 1 deletion models/SLICOT/beam/beam_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using ReachabilityBenchmarks, MathematicalSystems, LazySets, MAT

function beam_model()
file = matopen(@relpath "beam.mat")
file = matopen(@current_path "beam.mat")

# system matrix
A = read(file, "A")
Expand Down
4 changes: 2 additions & 2 deletions models/SLICOT/beam/beam_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "beam_model.jl")
include(@relpath "beam_specifications.jl")
include(@current_path "beam_model.jl")
include(@current_path "beam_specifications.jl")

S = beam_model()
X0, options = beam_specification()
Expand Down
2 changes: 1 addition & 1 deletion models/SLICOT/building/building_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using ReachabilityBenchmarks, MathematicalSystems, LazySets, MAT

function building_model()
file = matopen(@relpath "building.mat")
file = matopen(@current_path "building.mat")

# system matrix
A = read(file, "A")
Expand Down
4 changes: 2 additions & 2 deletions models/SLICOT/building/building_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "building_model.jl")
include(@relpath "building_specifications.jl")
include(@current_path "building_model.jl")
include(@current_path "building_specifications.jl")

S = building_model()
X0, options = building_specification()
Expand Down
2 changes: 1 addition & 1 deletion models/SLICOT/cdplayer/cdplayer_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using ReachabilityBenchmarks, MathematicalSystems, LazySets, MAT

function cdplayer_model()
file = matopen(@relpath "cdplayer.mat")
file = matopen(@current_path "cdplayer.mat")

# system matrix
A = read(file, "A")
Expand Down
4 changes: 2 additions & 2 deletions models/SLICOT/cdplayer/cdplayer_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "cdplayer_model.jl")
include(@relpath "cdplayer_specifications.jl")
include(@current_path "cdplayer_model.jl")
include(@current_path "cdplayer_specifications.jl")

S = cdplayer_model()
X0, options = cdplayer_specification()
Expand Down
2 changes: 1 addition & 1 deletion models/SLICOT/fom/fom_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using ReachabilityBenchmarks, MathematicalSystems, LazySets, MAT

function fom_model()
file = matopen(@relpath "fom.mat")
file = matopen(@current_path "fom.mat")

# system matrix
A = float(read(file, "A")) # the matrix has Int entries
Expand Down
4 changes: 2 additions & 2 deletions models/SLICOT/fom/fom_run.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ReachabilityBenchmarks, MathematicalSystems, Reachability, Plots

include(@relpath "fom_model.jl")
include(@relpath "fom_specifications.jl")
include(@current_path "fom_model.jl")
include(@current_path "fom_specifications.jl")

S = fom_model()
X0, options = fom_specification()
Expand Down
Loading

0 comments on commit e42c9d3

Please sign in to comment.