第一范文网 - 专业文章范例文档资料分享平台

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

来源:用户分享 时间:2025/5/15 23:47:05 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

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

public void giveOutPlantByComp() {

double sumComp = this.getSumCompetitiveness(); double sumPlant = this.getSumPlant(); for (Organism organism : organisms) { }

35

}

public void enoughPlant() { }

//System.out.println(\

for (Organism organism : organisms) { }

if (getSumPlantNeed() > percent) {

percent = percent + 1.0 - getSumPlantNeed(); groundType--;

groundLevel = (int) (percent / 0.2);

//System.out.println(organism.getPlantNeeded()); organism.getFood(organism.getPlantNeeded());

}else{ }

percent = percent - getSumPlantNeed(); groundLevel = (int) (percent / 0.2);

organism.getFood(sumPlant

* (organism.getCompetitivenessByGround(this) / sumComp));

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

public int findTheWeakest() {

if (organisms.size() > 0) {

int tempIndex = 0;

double minComp = organisms.get(0).getCompetitivenessByGround(this); for (int index = 0; index < organisms.size(); index++) { }

return tempIndex;

if (minComp > organisms.get(index).getCompetitivenessByGround( }

this)) {

public void killweakestUnitlEnough(double foodHad, double foodNeed) { }

double food = organisms.get(findTheWeakest()).beEatedToMeat(); tempKillList.add(organisms.get(findTheWeakest())); if (food + foodHad < foodNeed) { }

killweakestUnitlEnough(food + foodHad, foodNeed);

}

if(groundType!=0){ }

groundType=0; groundLevel = 4; percent=0.9;

tempIndex = index;

} else {

return -1;

36

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

// (1+生物竞争力-该地平均竞争)*((草食物量-草食需求)*该生物草食性+(肉食物量-}

}

肉食需求)*该生物肉食性)

public void lineToUnit(String[] str) {

if (str.length == 4) {

this.x = Integer.valueOf(str[0]); this.y = Integer.valueOf(str[1]);

37

public double getScoreByOrganism(Organism organism) {

if (this.getGroundType() == 3) { }

double factor = 0; double avgComp = 0;

if ((double) organisms.size() == 0) {

factor = 1; return 0;

} else { }

avgComp = this.getSumCompetitiveness() / (double) organisms.size(); factor = organism.getCompetitivenessByGround(this) / avgComp;

//System.out.println();

return factor * (getSumPlant() - getSumPlantNeed());

}

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

public boolean equals(GroundUnit obj) {

return this.getX() == obj.getX() && this.getY() == obj.getY()

&& this.getGroundType() == obj.getGroundType() && this.getGroundLevel() == obj.getGroundLevel();

38

}

}

this.groundType = Integer.valueOf(str[2]); this.groundLevel = Integer.valueOf(str[3]);

public void nextType() { }

groundType++; if (groundType == 4) { }

groundType = 0;

public void nextLevel() { }

groundLevel++; if (groundLevel == 5) { }

groundLevel = 0;

@Override

public String toString() { }

return \

+ groundLevel;

生命游戏-JAVA语言代码-细胞自动机-毕业论文.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c1q08w7s8491cf865cb4r_11.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top