获取变量范围 [英] Obtaining Range of variables

查看:66
本文介绍了获取变量范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想设计一个应用程序,它需要一组约束作为输入。


我不知道想要优化任何东西。


结果应该是显示给定约束集的所有变量的范围。


哪种方法我可以使用API​​来获得这样的结果。


 


例如 - :约束 - >  y< 20,x< y。


上述限制的结果应该是  - :y< 20,x< 19。


 


上述任何帮助都将受到赞赏。


提前致谢 

解决方案

索尔弗先生,


你要求的最重要的事情是
FindAllowedValues方法
。 FindAllowedValues有点像Solve,除了需要

DecisionBinding
对象。这些对象会告诉您决策的可能值。重复的调用会给你不同的值 - 在第一次调用的例子中你可能会得到y = 19,x = 18;第二个y = 18,x = 17,依此类推。


我意识到这与得到范围不一样,但它很接近。



Hi,

I want to design an application such that it takes a set of constraints as input.

I do not want to optimize anything.

The result should be such that the range of all variables for the given set of constraints is displayed.

Which method of the API can i use to obtain such a result.

 

Eg -: Constraints -->  y < 20 , x < y.

The result for the above constraints should be  -: y < 20 , x < 19.

 

Any help for the above would be appreciated.

Thanks in advance 

解决方案

Hi Mr. Solver,

The cloest thing to what you are asking for is the FindAllowedValues method. FindAllowedValues is kind of like Solve, except it takes DecisionBinding objects. These objects tell you about the possible values for a decision. Repeated calls will give you different values - in your example for the first call you might get y=19, x=18; the second y=18, x=17, and so on.

I realize this is not the same as getting the range, but it is close.

Nathan


这篇关于获取变量范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆