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

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

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

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

public int getGroundLevel() {

return groundLevel;

39

}

// -------------------------get set------------------------- public int getX() { }

return x;

public void setX(int x) { }

this.x = x;

public int getY() { }

return y;

public void setY(int y) { }

this.y = y;

public int getGroundType() { }

return groundType;

public void setGroundType(int groundType) { }

this.groundType = groundType;

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

}

public void setOrganisms(List organisms) { }

this.organisms = organisms; public List getOrganisms() { }

return organisms;

public void setPercent(double percent) { }

this.percent = percent; public double getPercent() { }

return percent;

public void setGroundLevel(int groundLevel) { }

this.groundLevel = groundLevel; }

3.环境单元格类

package com.apei.lifegame.model.condition;

import javax.swing.JPanel;

public class GroundPanel extends JPanel{

40

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

}

private static final long serialVersionUID = -6915526788758258155L;

private GroundUnit ground;

public GroundPanel() { }

public GroundPanel(int x,int y) { }

public GroundUnit getGround() { }

public void setGround(GroundUnit ground) { }

this.ground = ground; return ground;

ground=new GroundUnit(x,y,0,0); ground=new GroundUnit();

4.色彩获取工具类

package com.apei.lifegame.util;

import java.awt.Color;

public class ColorHelper {

static String[][] colors = {

{

\

\

\

\

\

{ \

41

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

{ \

{ \

static String[] playerColors = {\

public static Color getColorFromTypeAndLevel(int type, int level) {

String color = colors[type][level];

String[] num = color.split(\

return new Color(Integer.valueOf(num[0]), Integer.valueOf(num[1]),

Integer.valueOf(num[2]));

}

//获取玩家颜色

public static Color getPlayerColor(int player){ }

// 随即颜色

public static Color getRandomColor() {

return

String[] num = playerColors[player].split(\

return new Color(Integer.valueOf(num[0]), Integer.valueOf(num[1]),

Integer.valueOf(num[2]));

Color.getHSBColor(Float.valueOf(String.valueOf(Math.random())), }

42

}

Float.valueOf(String.valueOf(Math.random())), Float.valueOf(String.valueOf(Math.random())));

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