Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Barbot
WordGen
Commits
e53dc99d
Commit
e53dc99d
authored
Jul 06, 2021
by
Benoit Barbot
Browse files
jsonify
parent
5bf546ef
Pipeline
#2217
passed with stages
in 2 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/OutFormat.ml
View file @
e53dc99d
...
...
@@ -176,18 +176,20 @@ struct
(
snd
@@
List
.
nth
accl
(
min
(
int_of_float
(
u1
*.
float
n
))
(
n
-
1
))
))
|>
StringMap
.
iter
(
fun
_
v
->
match
v
with
|
Some
(
tr
,
(
low
,
up
,
_
,
time
))
->
let
target
=
rgpoly
.
statelist
.
((
List
.
hd
tr
.
ZoneGraph
.
miniedge
)
.
target
)
in
fprintf
f
"{
\"
label
\"
:
\"
%s
\"
,@
\"
min_time
\"
: %g,@ \
\"
max_time
\"
:%g,@
\"
time
\"
:%g,@
\"
target
\"
:
\"
%s
\"
},@,"
tr
.
ZoneGraph
.
action
low
up
time
target
.
name
|
None
->
()
))
|>
(
fun
m
->
StringMap
.
fold
(
fun
_
v
acc
->
match
v
with
Some
x
->
x
::
acc
|
None
->
acc
)
m
[]
)
|>
List
.
iteri
(
fun
i
(
tr
,
(
low
,
up
,
_
,
time
))
->
let
target
=
rgpoly
.
statelist
.
((
List
.
hd
tr
.
ZoneGraph
.
miniedge
)
.
target
)
in
fprintf
f
"%s@ {
\"
label
\"
:
\"
%s
\"
,@
\"
min_time
\"
: %g,@ \
\"
max_time
\"
:%g,@
\"
time
\"
:%g,@
\"
target
\"
:
\"
%s
\"
}"
(
if
i
>
0
then
","
else
""
)
tr
.
ZoneGraph
.
action
low
up
time
target
.
name
))
rgpoly
.
ZoneGraph
.
statelist
.
(
get_loc
st
)
.
ZoneGraph
.
transition
|
Debug
->
fprintf
outfile
"@[<h 0>%a@. @[<v 2>@[<v 0>%a@]@]@]@."
...
...
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