Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cosyverif
Services
service adt2amas
Commits
2bed3908
Commit
2bed3908
authored
Jan 13, 2021
by
Jaime Arias
Browse files
fix output format for the minimal scheduling algorithm
parent
ac5791dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/cosyverif/service/adt2amas/MinimalScheduling.java
View file @
2bed3908
...
...
@@ -33,7 +33,7 @@ import org.cosyverif.model.Model;
authors
=
{
"Jaime Arias"
,
"Laure Petrucci"
,
"Wojciech Penczek"
,
"Wojciech Penczek"
,
"Teofil Sidoruk"
},
keywords
=
{})
...
...
@@ -46,7 +46,7 @@ public class MinimalScheduling extends BinaryService {
formalism
=
"http://formalisms.cosyverif.org/adtree.fml"
)
private
Model
modelParameter
;
@Parameter
(
name
=
"Scheduling Information"
,
@Parameter
(
name
=
"Scheduling Information"
,
help
=
"Scheduling information for each generated graph."
,
direction
=
Direction
.
OUT
,
multiline
=
true
)
...
...
@@ -101,49 +101,35 @@ public class MinimalScheduling extends BinaryService {
String
line
=
""
;
String
match
;
FileWriter
fw
=
null
;
try
{
File
fileOutput
=
new
File
(
baseDirectory
().
getAbsolutePath
()
+
"/"
+
modelFile
.
getName
()
+
".log"
);
fr
=
new
FileReader
(
fileOutput
);
br
=
new
BufferedReader
(
fr
);
fw
=
new
FileWriter
(
modelFile
.
getParent
()
+
"/debug.out"
);
fw
.
write
(
"writing output: \n"
);
line
=
br
.
readLine
();
if
(
line
!=
null
)
{
match
=
line
.
substring
(
line
.
indexOf
(
":"
)
+
1
).
trim
();
this
.
nGraphs
=
Integer
.
parseInt
(
match
);
fw
.
append
(
"n graphs: "
+
match
+
"\n"
);
}
while
(
this
.
nGraphs
>
0
&&
(
line
=
br
.
readLine
())
!=
null
)
{
// find a graph info
if
(
line
.
startsWith
(
"Graph #"
))
{
if
(
s
.
length
()
!=
0
)
{
s
.
append
(
"\n"
);
}
s
.
append
(
line
+
" => "
);
}
else
if
(
line
.
startsWith
(
"# Agents:"
))
{
s
.
append
(
line
+
" - "
);
}
else
if
(
line
.
startsWith
(
"# Slots:"
))
{
s
.
append
(
line
);
}
// new graph
if
(
line
==
""
&&
s
.
length
()
!=
0
)
{
s
.
append
(
"\n"
);
}
}
fw
.
append
(
"data:\n"
+
s
+
"\n"
);
}
catch
(
Exception
e
)
{
fw
.
append
(
"error: "
+
e
.
getMessage
()
+
"\n"
);
e
.
printStackTrace
();
}
finally
{
if
(
br
!=
null
)
br
.
close
();
if
(
fr
!=
null
)
fr
.
close
();
if
(
fw
!=
null
)
fw
.
close
();
}
return
s
.
toString
();
...
...
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