回答済み How to display the model in the Console?

  • 2012年8月2日 6:34
     
     

    Dear all,

    Is it possible to display the solver foundation model generated dynamically by C#? I believe that most time I cannot get correct result is because of the wrong definition of the model, not the solvers. However, it will be very helpful if I can see what I have defined before I try to solve it, for example, what is the goal of the model? What are the constraints? Are all of them available? Many thanks!

    Regards

    Zhigang Wu

すべての返信

  • 2012年8月3日 14:53
     
     回答済み コードあり

    For displaying the model in a console, you could use

    var tw = new StringWriter(new StringBuilder());
    ctx.SaveModel(FileFormat.OML, tw);
    Console.WriteLine(tw);

    where ctx is the SolverContext.

    - Raphael

    • 回答としてマーク Zhigang Wu 2012年8月6日 2:13
    •  
  • 2012年8月6日 2:13
     
     

    Raphael,

    Thank you very much! That's exactly what I want.

    Regards

    Zhigang Wu

    • 回答としてマーク Zhigang Wu 2012年8月6日 2:13
    • 回答としてマークされていない Zhigang Wu 2012年8月6日 2:13
    •