亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? modelswarm.java

?? Swarm是一個(gè)非常有用的仿真工具
?? JAVA
字號(hào):
// ModelSwarm.java
// The top-level ModelSwarm

import swarm.Globals;
import swarm.Selector;
import swarm.defobj.Zone;

import swarm.objectbase.Swarm;
import swarm.objectbase.SwarmImpl;

import swarm.activity.ActionGroupImpl;
import swarm.activity.ScheduleImpl;
import swarm.activity.Activity;

import swarm.space.Grid2dImpl;
import swarm.collections.ListImpl;

public class ModelSwarm extends SwarmImpl
{
    // Declare the model parameters and their default values.
    public int worldXSize = 80, worldYSize = 80;
    public double seedProb = 0.80;
    public double bugDensity = 0.10;
    public int endTime = 125;

    // Declare some other needed variables.
    public FoodSpace foodSpace;
    public Grid2dImpl bugSpace;
    public ListImpl bugList;
    public ScheduleImpl modelSchedule;

    // This is the constructor for a new ModelSwarm.  All we do is to
    // use the contructor for ModelSwarm's parent class.
    public ModelSwarm(Zone azone)
    {
	// Use the parent class to create a top-level swarm.
	super(azone);
    }

    // This is the method for building the model's objects: the food
    // space, the two-dimensional positioning grid, and the host of
    // bugs.
    public Object buildObjects()
    {
	int x, y, num;
	SimpleBug abug;

	// use the parent class buildObject() method to initialize the
	// process
	super.buildObjects();

	// Now create the model's objects.
	// First create the foodspace and seed it with food.
	foodSpace = new FoodSpace(Globals.env.globalZone, 
				  worldXSize, worldYSize);
	foodSpace.seedFoodWithProb( seedProb );

	// Then create a 2-D grid that will be used to keep track of
	// each bug's position, insuring that no two bugs will ever be
	// on the same cell. Initialize the grid to be emglobalZone, 
				   worldXSize, worldYSize);
	bugSpace.fastFillWithObject(null);pty.
	bugSpace = new Grid2dImpl(Globals.env.

	// Now create a List object to manage all the bugs we are
	// about to create.
	bugList = new ListImpl(Globals.env.globalZone);

	// Iterate over the grid with a certain probability of
	// creating a bug at each site.  If a bug is created, put it
	// on the grid and add it to the end of the bug list.  Note
	// that we increment the bug number, num, each time a bug is
	// created.
	num = 0;
	for (y = 0; y < worldYSize; y++)
	    for (x = 0; x < worldXSize; x++)
		if ( Globals.env.uniformDblRand.getDoubleWithMin$withMax(
						  0.0, 1.0) <= bugDensity)
		    {
		    abug = new SimpleBug(Globals.env.globalZone, foodSpace, 
					 bugSpace, x, y, ++num);
		    bugSpace.putObject$atX$Y(abug, x, y);
		    bugList.addLast(abug);
		    }

	// Report the number of bugs created.
	System.out.println(bugList.getCount() + " bugs were created.");

	// There is no longer any need for a reporter bug as we will
	// be observing the bugs directly through the Observer Swarm.
	// So ...

	// We're done.
	return this;
    }

    // The next three methods return some useful information about the
    // created ModelSwarm to the caller.  They will be used by the
    // Observer Swarm.
    public ListImpl getBugList()
    {
	return bugList;
    }

    public Grid2dImpl getWorld()
    {
	return bugSpace;
    }

    public FoodSpace getFood()
    {
	return foodSpace;
    }

    // This is the method a) for building the list of actions for
    // these objects to accomplish and b) for scheduling these actions
    // in simulated time.
    public Object buildActions()
    {
	Selector sel;
	ActionGroupImpl modelActions;

	// First, use the parent class to initialize the process.
	super.buildActions();

	// Then create an ActionGroup object and insert both a
	// randomWalk message to every bug in the bug list and a
	// checkTime message to modelSwarm. Note that we have
	// routinized the creation of a Selector through a new
	// method. getSelector() is a static method in a new class,
	// SwarmUtils, contained in SwarmUtils.java. The method is
	// overloaded.  It takes either a class name string or an
	// object of the desired class as its first argument, and a
	// message string as the second. We use both forms here.
	modelActions = new ActionGroupImpl(getZone());

	sel = SwarmUtils.getSelector("SimpleBug", "randomWalk");
	modelActions.createActionForEach$message(bugList, sel);

	sel = SwarmUtils.getSelector(this, "checkTime");
	modelActions.createActionTo$message(this, sel);

	// Now create the schedule and set the repeat interval to unity.
	modelSchedule = new ScheduleImpl(getZone(), 1);

	// Finally, insert the action list into the schedule at period zero
	modelSchedule.at$createAction(0, modelActions);

	return this;
    }

    // This method specifies the context in which the model is to be run.
    public Activity activateIn(Swarm swarmContext)
    {
	// Use the parent class to activate ourselves in the context
	// passed to us.
	super.activateIn(swarmContext);

	// Then activate the schedule in ourselves.
	modelSchedule.activateIn(this);

	// Finally, return the activity we have built.
	return getActivity();
    }
	
    // This is a pretty crude method to end the simulation after an
    // arbitrary number of periods given by the endTime parameter. If
    // the simulation time returned by getCurrentTime() is greater
    // than endTime, we terminate the modelSwarm activity.  The
    // ObserverSwarm will pick this up and handle it.  Note that this
    // is no longer strictly necessary since the user can now stop the
    // simulation at any time using the control panel.  Still, this is
    // a placeholder for a more sophisticated end-of-simulation
    // routine to be introduced later.
    public void checkTime()
    {
	if (Globals.env.getCurrentTime() >= endTime)
	    getActivity().terminate();

        return;
    }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜诱惑制服诱惑色一区在线观看| 丝袜美腿亚洲一区二区图片| 91久久精品午夜一区二区| 亚洲风情在线资源站| 欧美国产精品专区| 欧美一区二区人人喊爽| 99国产精品久久久久久久久久| 日本成人在线网站| 亚洲精品乱码久久久久久| 精品三级av在线| 欧美性猛交一区二区三区精品| 国产成人8x视频一区二区| 天天av天天翘天天综合网| 国产欧美精品一区| 欧美成人vps| 欧美精品久久久久久久久老牛影院| 成人免费视频caoporn| 日韩一区精品字幕| 夜夜嗨av一区二区三区中文字幕 | 成人高清av在线| 精品一区二区久久| 日韩国产欧美视频| 亚洲天堂精品在线观看| 欧美极品美女视频| 久久久精品人体av艺术| 欧美精品一区二区三区蜜桃视频 | 日韩av一二三| 亚洲va韩国va欧美va精品| 亚洲私人影院在线观看| 国产视频在线观看一区二区三区 | 欧美日韩二区三区| 色哟哟一区二区在线观看| av一区二区三区在线| 高清av一区二区| 国产精品影音先锋| 极品少妇xxxx精品少妇| 美女视频一区二区三区| 青青草精品视频| 日韩成人精品视频| 日本不卡视频在线| 老汉av免费一区二区三区| 琪琪一区二区三区| 日本中文一区二区三区| 青青草视频一区| 久久爱www久久做| 韩国欧美一区二区| 国产九色sp调教91| 国产aⅴ精品一区二区三区色成熟| 国产精品资源在线| 成人做爰69片免费看网站| 99久久精品国产一区二区三区| 99综合影院在线| 色菇凉天天综合网| 欧美日韩国产综合一区二区三区| 欧美日韩精品三区| 欧美α欧美αv大片| 26uuu色噜噜精品一区| 精品国产91九色蝌蚪| 久久久久久99久久久精品网站| 国产欧美日韩在线看| 中文字幕中文字幕在线一区 | 九色|91porny| 狠狠色丁香婷综合久久| 国产成人精品影视| 一本久久精品一区二区| 欧美日韩精品欧美日韩精品 | 欧美视频在线一区| 日韩一级完整毛片| 久久美女艺术照精彩视频福利播放| 欧美国产激情一区二区三区蜜月| 综合欧美一区二区三区| 午夜欧美电影在线观看| 国内成+人亚洲+欧美+综合在线| 国产精品一区二区在线播放| 成人免费va视频| 欧美色图激情小说| 久久先锋影音av鲁色资源网| 国产精品福利电影一区二区三区四区| 有码一区二区三区| 蜜桃91丨九色丨蝌蚪91桃色| 国产成人久久精品77777最新版本| 色综合中文字幕国产 | 成人美女视频在线看| 欧美写真视频网站| 久久网站最新地址| 亚洲精品免费在线| 久久99久久精品| 在线精品视频一区二区三四| 欧美一级淫片007| 国产精品久久久久久久久果冻传媒 | 日韩精品资源二区在线| 一区在线观看视频| 日韩中文字幕91| www.欧美.com| 日韩欧美黄色影院| 尤物视频一区二区| 国产精品白丝jk黑袜喷水| 欧美日韩综合在线免费观看| 久久老女人爱爱| 日韩福利电影在线| 色综合色综合色综合色综合色综合| 日韩欧美国产麻豆| 亚洲免费av在线| 国产成人亚洲综合a∨婷婷| 欧美日韩二区三区| 亚洲激情图片一区| 成人夜色视频网站在线观看| 欧美日韩国产美女| 亚洲欧美偷拍另类a∨色屁股| 国产一区二区在线电影| 91精品国产综合久久小美女| 一区二区不卡在线视频 午夜欧美不卡在| 国产福利精品导航| 精品国产在天天线2019| 午夜欧美大尺度福利影院在线看 | 欧美在线观看视频一区二区三区| 国产日韩欧美综合一区| 美女免费视频一区二区| 欧美伦理视频网站| 亚洲黄色小说网站| 91性感美女视频| 国产精品女同互慰在线看| 国内成人精品2018免费看| 日韩欧美综合一区| 日韩电影在线看| 在线电影一区二区三区| 亚洲一区二区三区四区五区中文| 成人网在线播放| 久久亚洲精华国产精华液| 亚洲精品一区二区在线观看| 日韩国产欧美视频| 欧美日韩另类国产亚洲欧美一级| 中文字幕日韩av资源站| 成人黄色a**站在线观看| 精品欧美一区二区三区精品久久| 亚洲综合色区另类av| 99精品偷自拍| www国产精品av| 精品一区中文字幕| 日韩欧美成人一区| 日韩成人午夜精品| 欧美高清www午色夜在线视频| 欧美aa在线视频| 91精品蜜臀在线一区尤物| 亚洲五码中文字幕| 91亚洲精品乱码久久久久久蜜桃 | 久色婷婷小香蕉久久| 欧美日韩久久久| 另类小说综合欧美亚洲| 91精品国产综合久久久久久漫画 | 丝袜亚洲另类丝袜在线| 欧美性生活影院| 亚洲成人免费影院| 欧洲亚洲精品在线| 亚洲成人精品一区二区| 欧美亚洲动漫精品| 日韩中文字幕区一区有砖一区| 欧美日韩免费观看一区二区三区| 天堂在线一区二区| 日韩一区二区在线观看视频播放| 日韩激情av在线| 日韩欧美国产不卡| 老司机精品视频一区二区三区| 欧美国产精品一区二区| 99久久精品情趣| 亚洲国产一区二区三区| 欧美中文一区二区三区| 久久精品国产99| 久久尤物电影视频在线观看| 国内久久精品视频| 国产精品女同互慰在线看| 欧美人与z0zoxxxx视频| 久久精品国产亚洲高清剧情介绍 | 激情成人综合网| 国产性天天综合网| 99久久久免费精品国产一区二区| 国产精品久久久久影视| 99久久婷婷国产综合精品| 午夜成人免费电影| 久久男人中文字幕资源站| 波多野洁衣一区| 亚洲免费大片在线观看| 精品国产免费一区二区三区香蕉| 国产麻豆精品视频| 怡红院av一区二区三区| 91精品国产色综合久久| 国产一区不卡在线| 亚洲欧美日韩系列| 久久色中文字幕| 91免费观看视频| 日韩av不卡在线观看| 久久久久久久综合| 欧美二区三区的天堂| 国内精品视频666| 国产精品久久一级| 欧美一区二区三区在线观看视频| 国产一区二区三区av电影| 亚洲天堂网中文字| 欧美激情一区三区| 日韩三级电影网址|