GA如何以随机的方式填充染色体......? [英] GA how to fill the chromosome in a random way ...?

查看:111
本文介绍了GA如何以随机的方式填充染色体......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 i ' 使用遗传算法为我的大学做一个计划生成器我做了一个代表问题的染色体, 
i希望 知道如何以方式填充染色体,尊重硬约束,如:(两个lecteur可以' 同时在同一个房间......)使用random()函数

解决方案

假设你的下一代过程将包括染色体的突变和交叉,其中一些将产生致命遗传缺陷的病例,即染色体不符合硬约束。您将需要从群体中删除这些。

您可以使用相同的过程去除任何随机生成的具有致命遗传缺陷的初始染色体。

重复
生成一个随机染色体
如果它是有效的,放入初始种群集
直到人口有所需数量的个体


没有解决方案,因为这不是问题!



首先选择一种语言然后说出哪一种语言。



您描述了您想要/必须做的事情:开始工作。



当你遇到困难时,请回来你已经完成的一段代码并解释了你的问题。



否则,它看起来像是我的工作,这不是我们在这里做的。

i'm doing a schedule generator for my university using a genetic algorithm and i made a chromosome that represent the problem ,
i want to know how to fill the chromosome in a random way respecting the hard constraint like: (two lecteur can't be in the same room at the same time ....) using a random()  function

解决方案

Assuming that your next generation process will include mutation and cross-over of chromosomes, some of those will generate cases of "fatal genetic defects" I.e., chromosomes that don't meet the hard constraints. You will need to remove these from the population.
You can use the same process to remove any randomly generated initial chromosomes that have the "fatal genetic defect".

Repeat
  generate a random chromosome
  if it is valid, put into initial population set
until population has desired count of "individuals"


There is no solution because this is not a question !

First choose a language and say which one.

You described what you want/have to do: start working.

When you are stuck, come back with the piece of code you have done and explain what is your problem.

Otherwise, it look like a do my work, which is not what we do here.


这篇关于GA如何以随机的方式填充染色体......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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