You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of OR-Tools and what language are you using?
Version: 9.8
Language: python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
CP-SAT What operating system (Linux, Windows, ...) and version?
Mac Apple M2 Mac Os 13.0 What did you do?
Steps to reproduce the behavior:
a text model file return different solution status, sometimes it is feasible, sometimes not
What did you expect to see
the feasible status should be consistent, which is feasible in my case What did you see instead?
as above mentioned
Make sure you include information that can help us debug (full error message, model Proto).
#coding=utf-8fromortools.sat.pythonimportcp_modelfromgoogle.protobufimporttext_formatimportpickleimportosdefsolve(file):
model=cp_model.CpModel()
withopen(file, "r") asfile:
text_format.Parse(file.read(), model.Proto())
# Create a solver and solvesolver=cp_model.CpSolver()
solver.parameters.max_time_in_seconds=120# solver.parameters.log_search_progress = Truestatus=solver.Solve(model)
# Check the solutionifstatus==cp_model.OPTIMAL:
print('Objective value =', solver.ObjectiveValue())
elifstatus==cp_model.FEASIBLE:
print('A potentially suboptimal solution was found.')
elifstatus==cp_model.INFEASIBLE:
print('The problem is infeasible.')
else:
print('ohter status')
if__name__=='__main__':
file='./../../output/test.pd.txt'foriinrange(1, 10):
print(f'----------iteration: {i}----------')
solve(file)
print('done')
----------iteration: 1----------
Objective value = 283621783174.0
----------iteration: 2----------
The problem is infeasible.
----------iteration: 3----------
The problem is infeasible.
----------iteration: 4----------
The problem is infeasible.
----------iteration: 5----------
The problem is infeasible.
----------iteration: 6----------
The problem is infeasible.
----------iteration: 7----------
The problem is infeasible.
----------iteration: 8----------
The problem is infeasible.
----------iteration: 9----------
The problem is infeasible.
done
Anything else we should know about your project / environment
The text was updated successfully, but these errors were encountered:
What version of OR-Tools and what language are you using?
Version: 9.8
Language: python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
CP-SAT
What operating system (Linux, Windows, ...) and version?
Mac Apple M2 Mac Os 13.0
What did you do?
Steps to reproduce the behavior:
a text model file return different solution status, sometimes it is feasible, sometimes not
What did you expect to see
the feasible status should be consistent, which is feasible in my case
What did you see instead?
as above mentioned
Make sure you include information that can help us debug (full error message, model Proto).
----------iteration: 1----------
Objective value = 283621783174.0
----------iteration: 2----------
The problem is infeasible.
----------iteration: 3----------
The problem is infeasible.
----------iteration: 4----------
The problem is infeasible.
----------iteration: 5----------
The problem is infeasible.
----------iteration: 6----------
The problem is infeasible.
----------iteration: 7----------
The problem is infeasible.
----------iteration: 8----------
The problem is infeasible.
----------iteration: 9----------
The problem is infeasible.
done
Anything else we should know about your project / environment
The text was updated successfully, but these errors were encountered: