OptaPlanner是否支持对连续变量进行优化和约束? [英] Does OptaPlanner support optimizations and constraints on continuous variables?

查看:137
本文介绍了OptaPlanner是否支持对连续变量进行优化和约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读文档中矛盾的内容.

I'm reading contradictory things in the documentation.

一方面,这段话似乎表明可能存在连续的计划变量:

On one hand, this passage seems to indicate that continuous planning variables are possible:

计划值范围是针对某项的可能的计划值的集合 规划变量.该集合可以是离散的(例如,第1、2、3行 或4)或连续(例如0.0到1.0之间的任何两倍).

A planning value range is the set of possible planning values for a planning variable. This set can be a discrete (for example row 1, 2, 3 or 4) or continuous (for example any double between 0.0 and 1.0).

另一方面,在定义计划变量时,必须在用于值集的字段上指定ValueRangeProvider批注:

On the other hand, when defining a Planning Variable, you must specify a ValueRangeProvider annotation on a field to use for the value set:

Solution实现具有返回Collection的方法.任何 该集合的价值是为此可能的计划价值 规划变量.

The Solution implementation has method which returns a Collection. Any value from that Collection is a possible planning value for this planning variable.

这两个摘要都在文档的同一部分中(

Both of these snippets are in the same section of the documentation (http://docs.jboss.org/drools/release/latest/optaplanner-docs/html_single/#d0e2518)

那是什么?我可以使用完整的double作为我的计划变量,还是需要将其范围限制为特定Collection中的值?

So, which is it? Can I use a full double as my planning variable, or do I need to restrict its range to the values in a specific Collection?

查看提供的实际算法,我看不到任何实际上最适合优化连续变量的算法,因此我怀疑是否有可能,但是最好对此加以澄清和明确说明.

Looking at the actual algorithms are provided, I don't see any that are actually suitable for optimizing continuous variables, so I doubt it's possible, but it'd be nice to have that clarified and made explicit.

推荐答案

我们正在努力完全支持连续变量.但是当前(在6.0.0.CR2中)还没有得到很好的支持.

We're working towards fully supporting continuous variables. But currently (in 6.0.0.CR2) it's not decently supported yet.

值范围确实可以是连续范围,但实际使用它们的途径还不存在.我们最近取得了良好的进展,请参见 https://issues.jboss.org/browse/PLANNER-160 .

Value ranges can indeed be continuous ranges, but the plumbing to actually use them isn't there yet. We have made good progress recently, see https://issues.jboss.org/browse/PLANNER-160.

这是它的工作方式: 您还可以在返回ValueRange(而不是Collection)的方法上使用@ValueRangeProvider注释.

Here's how it will work: You 'll be able to use a @ValueRangeProvider annotation on a method that returns a ValueRange (instead of a Collection) too.

A ValueRange将是一个接口,它支持选择随机值,获取大小,... 现成的我们将支持IntValueRangeDoubleValueRangeBigDecimalValueRange,... (实施细节:我们将这些Collection-returning方法改编为CollectionValueRange.)

A ValueRange will be an interface supports selecting a random value, getting a size, ... Out-of-the-box we will support IntValueRange, DoubleValueRange, BigDecimalValueRange, ... (Implementation detail: we'll retro-fit those Collection-returning methods into a CollectionValueRange.)

然后ValueSelector实现将直接使用它.

Then the ValueSelector implementations will use that directly.

关于优化连续变量的适用性:

As for the suitability to optimize continuous variables:

  • JIT随机选择将迅速发展,并且具有非常高的存储效率.
  • 如果您遇到NP完全/NP困难的问题,那么OptaPlanner将是一个很好的选择.如果您只有连续变量(而不是单个离散变量),那么您的问题就不太可能是NP完全的(除非您的约束反驳了这一点),在这种情况下,最好还是使用自定义的手工多项式算法(因为它不是NP完整的,所以有一个简单"的解决方案).

这篇关于OptaPlanner是否支持对连续变量进行优化和约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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