メインコンテンツへスキップ

Different methods to solve a model

回答済み

コメント

2件のコメント

  • Jonasz Staszek
    • Community Moderator Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Hi Jose,

    as far as I know, each gp.Model() is a separate object in Python, and hence, it will contain all the constraints and variables which were added to it.

    If your models are not too big, you could try generating a copy of the model and then use the two solution methods on the two model instances separately. If this is not the case, you'll have to remove the variables and constraints you don't need "manually".

    Hope this helps.

    Best regards
    Jonasz

    1
  • Jose Vindel
    • Gurobi-versary
    • Thought Leader
    • Investigator

    Hi Jonasz,

    Thanks so much for your answer

    It is actually the opposite, I've noticed that when building the linear constraints it takes quite a while (+1000 linear equations) so I wanted to have the model already built and then just run it through the different methods. To save some time when creating the object. It is clear that what I want to do will have to be implemented by adding and removing manually. I'll try it, and it might be the case that the time is cut down (hopefully).

    Best regards

    Jose

    0

サインインしてコメントを残してください。