Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different results when I print the program #5

Open
marcsans opened this issue May 27, 2015 · 0 comments
Open

Different results when I print the program #5

marcsans opened this issue May 27, 2015 · 0 comments

Comments

@marcsans
Copy link

I have different results when I print my model before solving it. On simple cases, I get the wrong answer without printing the model before and I get the write answer when I print the model.

I use a object oriented structure : my pycpx model is a property of a class and so are the variables and constraints. I use linked lists and matrix to store the variables.

I also noticed something before discovering this "print model" trick: I solved the program and make pycpx give me the left and right term of a constraint, I found a constraint that was not satisfied. However, the right term was given between [[ and ]] whereas the right term was given as a float number.

This is my function :

def solveMblp(self):
    print self.m
    bsum = self.b[0].sum()
    for k in range(1, len(self.b)):
        bsum += self.b[k].sum()
    self.m.maximize(bsum)

Please ask me for the full code if you need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant