Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MarkovProcesses.jl
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
Container 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
Bentriou Mahmoud
MarkovProcesses.jl
Commits
b3e1e771
Commit
b3e1e771
authored
4 years ago
by
Bentriou Mahmoud
Browse files
Options
Downloads
Patches
Plain Diff
pretty print lha + better semantic for true inv predicate
parent
608d99b5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
automata/automaton_F.jl
+1
-1
1 addition, 1 deletion
automata/automaton_F.jl
automata/automaton_G.jl
+1
-1
1 addition, 1 deletion
automata/automaton_G.jl
automata/automaton_G_and_F.jl
+1
-1
1 addition, 1 deletion
automata/automaton_G_and_F.jl
core/lha.jl
+31
-0
31 additions, 0 deletions
core/lha.jl
with
34 additions
and
3 deletions
automata/automaton_F.jl
+
1
−
1
View file @
b3e1e771
...
...
@@ -5,7 +5,7 @@ function create_automaton_F(m::ContinuousTimeModel, x1::Float64, x2::Float64, t1
locations
=
[
:
l0
,
:
l1
,
:
l2
,
:
l3
]
## Invariant predicates
true_inv_predicate
=
(
x
::
Vector
{
Int
})
->
return
true
true_inv_predicate
(
x
::
Vector
{
Int
})
=
true
Λ_F
=
Dict
(
:
l0
=>
true_inv_predicate
,
:
l1
=>
true_inv_predicate
,
:
l2
=>
true_inv_predicate
,
:
l3
=>
true_inv_predicate
)
...
...
This diff is collapsed.
Click to expand it.
automata/automaton_G.jl
+
1
−
1
View file @
b3e1e771
...
...
@@ -5,7 +5,7 @@ function create_automaton_G(m::ContinuousTimeModel, x1::Float64, x2::Float64, t1
locations
=
[
:
l0
,
:
l1
,
:
l2
,
:
l3
,
:
l4
]
# Invariant predicates
true_inv_predicate
=
(
x
::
Vector
{
Int
})
->
return
true
true_inv_predicate
(
x
::
Vector
{
Int
})
=
true
Λ_F
=
Dict
(
:
l0
=>
true_inv_predicate
,
:
l1
=>
true_inv_predicate
,
:
l2
=>
true_inv_predicate
,
:
l3
=>
true_inv_predicate
,
:
l4
=>
true_inv_predicate
)
...
...
This diff is collapsed.
Click to expand it.
automata/automaton_G_and_F.jl
+
1
−
1
View file @
b3e1e771
...
...
@@ -9,7 +9,7 @@ function create_automaton_G_and_F(m::ContinuousTimeModel, x1::Float64, x2::Float
:
l1F
,
:
l2F
,
:
l3F
]
# Invariant predicates
true_inv_predicate
=
(
x
::
Vector
{
Int
})
->
return
true
true_inv_predicate
(
x
::
Vector
{
Int
})
=
true
Λ_F
=
Dict
(
:
l0G
=>
true_inv_predicate
,
:
l1G
=>
true_inv_predicate
,
:
l2G
=>
true_inv_predicate
,
:
l3G
=>
true_inv_predicate
,
:
l4G
=>
true_inv_predicate
,
...
...
This diff is collapsed.
Click to expand it.
core/lha.jl
+
31
−
0
View file @
b3e1e771
...
...
@@ -16,6 +16,37 @@ getindex(S::StateLHA, l_var::Vector{VariableAutomaton}) = [S[var] for var in l_v
setindex!
(
S
::
StateLHA
,
val
::
Int
,
var
::
VariableAutomaton
)
=
S
[
var
]
=
convert
(
Float64
,
val
)
setindex!
(
S
::
StateLHA
,
val
::
Bool
,
var
::
VariableAutomaton
)
=
S
[
var
]
=
convert
(
Float64
,
val
)
function
Base.show
(
io
::
IO
,
A
::
LHA
)
print
(
io
,
"LHA
\n
"
)
print
(
io
,
"- locations :
$
(join(A.locations,','))
\n
"
)
print
(
io
,
"- initial locations :
$
(join(A.locations_init,','))
\n
"
)
print
(
io
,
"- final locations :
$
(join(A.locations_final,','))
\n
"
)
print
(
io
,
"- labeling prop Λ :
\n
"
)
for
loc
in
keys
(
A
.
Λ
)
print
(
io
,
"*
$
loc:
$
(Symbol(A.Λ[loc]))
\n
"
)
end
print
(
io
,
"- variables :
\n
"
)
for
(
var
,
idx
)
in
A
.
map_var_automaton_idx
print
(
io
,
"*
$
var (index =
$
idx in variables space)
\n
"
)
end
print
(
io
,
"- flow :
\n
"
)
for
(
loc
,
flow_loc
)
in
A
.
flow
print
(
io
,
"*
$
loc:
$
flow_loc
\n
"
)
end
print
(
io
,
"- edges :
\n
"
)
for
from_loc
in
keys
(
A
.
map_edges
)
for
to_loc
in
keys
(
A
.
map_edges
[
from_loc
])
edges
=
A
.
map_edges
[
from_loc
][
to_loc
]
print
(
io
,
"*
$
from_loc =>
$
to_loc (
$
(length(edges))):
$
(join(edges,','))
\n
"
)
end
end
print
(
io
,
"- constants :
\n
"
)
for
(
name_constant
,
val_constant
)
in
A
.
constants
print
(
io
,
"*
$
name_constant:
$
val_constant
\n
"
)
end
print
(
io
,
"- transitions :
$
(join(A.transitions,','))
\n
"
)
end
function
Base.show
(
io
::
IO
,
S
::
StateLHA
)
print
(
io
,
"State of LHA
\n
"
)
print
(
io
,
"- location:
$
(S.loc)
\n
"
)
...
...
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