-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ObjV不合法的问题 #333
Comments
《Geatpy数据结构》的文档有讲解ObjV要符合什么样的格式。 |
但是现在我的ObjV就是二维数组,不知道哪里有问题 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-- coding: utf-8 --
import numpy as np
import geatpy as ea
A = 2 # x方向有A个货位
B = 2 # y方向有B个货架
C = 3 # z方向有C层
L = 10 # 货位的长、宽、高
vx = 1 # 叉车的x速度
vy = 0.5 # 叉车的y速度
vz = 2 # 叉车的z速度
Num_jz = ABC
good_list = [[1, [1, 1, 1], 0.05], [2, [1, 1, 2], 0.03], [3, [1, 1, 3], 0.06]]
生成 x, y, z 坐标的矩阵
x, y, z = np.meshgrid(np.arange(A), np.arange(B), np.arange(C), indexing='ij')
将三维矩阵转换为一维数组并编号
xyz = np.column_stack((x.reshape(-1), y.reshape(-1), z.reshape(-1)))
class MyProblem(ea.Problem): # 继承Problem父类
调用main,会报错:Objv不合法
怎么解决呢
The text was updated successfully, but these errors were encountered: