定制移动实施 [英] Custom move implementation

查看:87
本文介绍了定制移动实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建自定义移动时,需要实现方法"getPlanningEntities","getPlanningValues".在这些方法中,需要将实体和值添加到列表中并返回.

When creating a custom move the methods "getPlanningEntities" , "getPlanningValues" need to be implemented. In these methods the entities and values need to be added in a list and returned.

在我的自定义举动中,我正在更改属于不同计划实体类的多个计划实体实例.

In my custom move I am changing multiple planning entity instances that belong to different planning entity classes.

打开FULL_ASSERT时,一切正常,没有错误.

When turning on FULL_ASSERT everything is ok there are no errors.

我只是想知道"getPlanningEntities"返回的计划实体的顺序应该与"getPlanningValues"返回的值的顺序相同(这是我现在要做的,但是我想知道"getPlanningEntities"和"getPlanningValues"是如何工作的.)我知道它们用于entityTabu和valueTabu.

I just wanted to know should the order of the planning entities that are returned by "getPlanningEntities" be the same as the order of the values that are returned by "getPlanningValues" (this is how I do it now but I wanted to know how "getPlanningEntities" and "getPlanningValues" operate).I know they are used for entityTabu and valueTabu.

还有什么时候调用"equals"和"hashCode"方法时,我只是打印出文本以查看它们何时被调用但没有出现?

Also when are "equals" and "hashCode" methods called I am printing out text just to see when they are called but it doesn’t appear?

推荐答案

Move.equals()hashCode()仅用于moveTabu(不是很好,我很少使用它).

Move.equals() and hashCode() are only use for moveTabu (which isn't that great, I hardly ever use it).

getPlanningEntities()getPlanningValues()的返回值的顺序无关紧要,但是在大多数情况下(链式情况除外),它们返回不同类型的元素.例如,在cloudBalancing中,getPlanningEntities()返回进程的集合,而getPlanningValues()返回计算机的集合.在变更动作中,这两个集合都是单例.

The order of the return values of getPlanningEntities() and getPlanningValues() doesn't matter, but they return different type of elements in most cases (except in chained cases). For example in cloudBalancing, getPlanningEntities() returns a collection of processes and getPlanningValues() returns a collection of computers. In a change move, both those collections are a singleton.

有关灵感,请参见CloudComputerChangeMoveCloudProcessSwapMove.

这篇关于定制移动实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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