利用JAVA实现的利用进化算法对人口增长进行仿真的源码

源代码在线查看: person.java

软件大小: 36 K
上传用户: zyz5925629
关键词: JAVA 进化算法 仿真 源码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * Person.java
				 *
				 * Created on 12 October 2006, 08:07
				 *
				 * To change this template, choose Tools | Template Manager
				 * and open the template in the editor.
				 */
				
				package wpc.data;
				import java.awt.Graphics;
				import java.util.Date;
				import java.text.DateFormat;
				import java.text.SimpleDateFormat;
				/**
				 *
				 * @author User
				 */
				public class Person extends DataObject{
				    /*
				     *A person should have:
				     *A First Name
				     *A second Name
				     *An age
				     *A genetics array
				     *No link infomation should be stored here for the parents, instead use
				     *a FAMILYTREE object, that everyone gets added to.
				     *Store Job infomation here?
				     *Store wife/infomation here?  Could posibly use the family tree to find
				     *mates, again reducing the size.
				     */
				    /** Creates a new instance of Person */
				    
				    public Person(wpc.MainFrame mainFrame) {
				        super(mainFrame);
				        createData(0);
				    }
				    
				    public void createData(int number){
				        if(mainFrame.getMaxWorldTraversal() >= 6) {
				           if(mainFrame.getDelayPerson()){
				             try {
				                Thread.sleep(mainFrame.getDelayPersonValue());
				                //System.out.println("Checking");
				             } catch (InterruptedException e){
				                // the VM doesn't want us to sleep anymore,
				                // so get back to work
				             }
				           }
				        }
				    }
				    
				   public void draw(Graphics g){
				        
				    }
				    
				    public void calcYear(){
				
				    }
				    
				}
							

相关资源