Skip to content
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

官网进不去 #369

Open
fuyingchao opened this issue Jun 26, 2024 · 5 comments
Open

官网进不去 #369

fuyingchao opened this issue Jun 26, 2024 · 5 comments

Comments

@fuyingchao
Copy link

http://geatpy.com/
这个网站为啥不能访问了

@zibinpan
Copy link

@fuyingchao hi~同学你好,原官网已于5今年月份停止维护了。现在全部转到了github上。

@xqb-python
Copy link

新的官网例子在哪,找了半天没找到,请告知,十分感谢

@geatpy-dev
Copy link
Owner

@xqb-python
Copy link

大佬您好,我安装了最新的2.7.0版本,但是以前的代码运行出错了。我想知道以前的geatpy版本是哪个
最大的改动是:
class MyProblem(ea.Problem): # 继承Problem父类
def init(self):
name = 'MyProblem' # 初始化name(函数名称,可以随意设置)
M = No_opt # 优化目标个数
maxormins = [-1] * No_opt # 初始化maxormins(目标最小最大化标记列表,1:最小化该目标;-1:最大化该目标)
Dim = No_var # 初始化Dim(决策变量维数)
varTypes = [0]*No_var # 初始化varTypes(决策变量的类型,0:实数;1:整数)
lb = [0]*No_var # 决策变量下界
ub = [1]*No_var # 决策变量上界
lbin = [1]*No_var # 决策变量下边界(0表示不包含该变量的下边界,1表示包含)
ubin = [1]*No_var # 决策变量上边界(0表示不包含该变量的上边界,1表示包含)
# 调用父类构造方法完成实例化
ea.Problem.init(self, name, M, maxormins, Dim, varTypes, lb, ub, lbin, ubin)

def evalVars(self, Vars):  # 目标函数
    f1 = model[0].predict_values(Vars)
    f2 = model[1].predict_values(Vars)
    f3 = model[2].predict_values(Vars)
    ObjV = np.hstack([f1, f2, f3])  # 计算目标函数值矩阵
    # ObjV = np.hstack([f1, f2])  # 计算目标函数值矩阵
    # CV = -Vars ** 2 + 2.5 * Vars - 1.5  # 构建违反约束程度矩阵
    return ObjV

以前的版本中Vars就是一个值,现在变成了种群对应的值,把我给搞懵了。跪求以前的版本号

@geatpy-dev
Copy link
Owner

@xqb-python 按照demo来改成自己的代码看看。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants