Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Conversion
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vladislav Kiselev
Conversion
Commits
78d614f3
Commit
78d614f3
authored
Aug 15, 2019
by
Vladislav Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Вырезан один локальный solver.
parent
7dd601f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
27 deletions
+2
-27
src/inport/ConversionUtils/Solver.java
src/inport/ConversionUtils/Solver.java
+2
-27
No files found.
src/inport/ConversionUtils/Solver.java
View file @
78d614f3
...
@@ -15,11 +15,10 @@ import java.util.stream.Collectors;
...
@@ -15,11 +15,10 @@ import java.util.stream.Collectors;
public
class
Solver
{
public
class
Solver
{
public
enum
SolverName
{
public
enum
SolverName
{
Undefined
(
""
),
Undefined
(
""
),
Chuffed
(
"Chuffed"
),
Chuffed
(
"Chuffed"
);
OrTools
(
"OrTools"
);
public
final
String
text
;
public
final
String
text
;
public
static
final
String
legalValues
=
"\"Chuffed\"
, \"OrTools\"
"
;
public
static
final
String
legalValues
=
"\"Chuffed\""
;
SolverName
(
String
text
)
{
SolverName
(
String
text
)
{
this
.
text
=
text
;
this
.
text
=
text
;
...
@@ -145,30 +144,6 @@ public class Solver {
...
@@ -145,30 +144,6 @@ public class Solver {
solverProcess
=
pb
.
start
();
solverProcess
=
pb
.
start
();
break
;
break
;
}
}
case
OrTools:
{
isResultsInOutput
=
true
;
{
ProcessBuilder
lPB
=
new
ProcessBuilder
(
"mzn2fzn"
,
"-o"
,
flatZincConstraints
,
constraints
,
minizincData
);
Process
process
=
lPB
.
start
();
process
.
waitFor
();
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
process
.
getInputStream
()));
String
output
=
br
.
lines
().
collect
(
Collectors
.
joining
(
"\n"
));
if
(
output
.
trim
().
equals
(
"=====UNSATISFIABLE====="
))
{
task
.
setSolution
(
new
ArrayList
<>());
task
.
setSolution_result
(-
1
);
return
""
;
}
}
pb
=
new
ProcessBuilder
(
"external_tools/or-tools_flatzinc_Ubuntu-18.04-64bit_v7.2.6977/bin/fzn-or-tools"
,
flatZincConstraints
);
solverProcess
=
pb
.
start
();
break
;
}
case
Undefined:
{
case
Undefined:
{
if
(
flatZincSolver
.
isEmpty
())
{
if
(
flatZincSolver
.
isEmpty
())
{
return
"FlatZinc solver not defined!"
;
return
"FlatZinc solver not defined!"
;
...
...
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