云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 生命游戏-JAVA语言代码-细胞自动机-毕业论文

生命游戏-JAVA语言代码-细胞自动机-毕业论文

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 18:23:25

浙江理工大学本科毕业设计(论文)

public boolean getBirthFromOrganism(Organism organism) {

double percent=0;

if(Math.random()>LifeGameCommon.PAM){

percent = Math.random()*0.2-0.1;

private int x; private int y;

public Organism(int x,int y) { }

public Organism() { }

this.lifeTime = 80 ; this.bodySize = 10.0; this.speed = 5.0; this.strength = 5.0; this.age = 0;

this.adulthoodAge = 20; this.condition = 60; this.reproduceblank=15.0; this.reproduceState = 0; this.foodCondition=1; this(); this.x = x; this.y = y; // 繁殖周期

private double reproduceblank;

}else{

if(Math.random()>=0.5){

23

生命游戏的计算机模拟以及参数对运行结果的分析

} //TODO

double randomNum=Math.random()*6;

this.lifeTime = organism.getLifeTime(); this.bodySize = organism.getBodySize(); this.speed = organism.getSpeed(); this.strength = organism.getStrength();

this.adulthoodAge =organism.getAdulthoodAge(); this.reproduceblank=organism.getReproduceblank();

this.foodCondition=100;

if(randomNum<1){

this.lifeTime = organism.getLifeTime()*(percent+1.0);

percent = LifeGameCommon.PAMPercent;

}else{ }

percent = -LifeGameCommon.PAMPercent;;

}else if(randomNum<2){

this.bodySize = organism.getBodySize()*(percent+1.0); if(bodySize<0.01){ }

bodySize=0.01;

}else if(randomNum<3){

this.speed = organism.getSpeed()*(percent+1.0);

}else if(randomNum<4){

this.strength = organism.getStrength()*(percent+1.0);

24

浙江理工大学本科毕业设计(论文)

}

public double getWeakPercentByAge(){ }

25

}else if(randomNum<5){

this.adulthoodAge = organism.getAdulthoodAge()*(percent+1.0);

}else if(randomNum<6){ }

this.condition = 100; this.reproduceState = 0; this.age = 0;

this.x = organism.getX(); this.y = organism.getY(); return true;

this.reproduceblank = ((double)organism.getReproduceblank()*(1.0+percent));

if(reproduceblank

reproduceblank=lifeTime*0.2;

double dAge = this.age; double lifeTime = this.lifeTime;

if(dAge/lifeTime<0.2){

return 0.2+dAge/lifeTime/0.2*0.8;

}else if(dAge/lifeTime>0.8){

return 1-(lifeTime-dAge)/lifeTime/0.2*0.8;

}else{ }

return 1.0;

生命游戏的计算机模拟以及参数对运行结果的分析

// 获取生物竞争力,

public double getCompetitivenessByGround(GroundUnit groundUnit) {

double competitiveness = getWeakPercentByAge(); if(groundUnit.getGroundType()==0){ }

if(groundUnit.getGroundType()==1){ }

if(groundUnit.getGroundType()==2){ }

//System.out.println(\

26

competitiveness*=(strength*3+speed*7*1.2); if(bodySize<=5){

competitiveness*=(5/bodySize);

}else if(bodySize>=45){ }

competitiveness*=(bodySize/45);

competitiveness*=(strength*3+speed*7*1.2); if(bodySize<=25){

competitiveness*=(25/bodySize);

}else if(bodySize>=80){ }

competitiveness*=(bodySize/80);

competitiveness*=(strength*3+speed*7*1.2); if(bodySize<=45){

competitiveness*=(5/bodySize);

}else if(bodySize>=150){ }

competitiveness*=(bodySize/150);

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

浙江理工大学本科毕业设计(论文) public boolean getBirthFromOrganism(Organism organism) { double percent=0; if(Math.random()>LifeGameCommon.PAM){ percent = Math.random()*0.2-0.1; private int x; private int y; public Organism(int x,int y) { } public Organism() { } this.lifeTime = 80 ; this.bodySize = 1

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com