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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? modelswarm.java~

?? Swarm是一個非常有用的仿真工具
?? JAVA~
字號:
// 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;


public class ModelSwarm extends SwarmImpl
{
    // Declare the model parameters and their default values.
    public int worldXSize = 40, worldYSize = 40;
    public double seedProb = 0.20;
    public int endTime = 20000;

    // Declare some other needed variables.
    FoodSpace foodSpace;
    SimpleBug abug;
    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: in this
    // case the food space and the bug.
    public Object buildObjects()
    {
	int xPos, yPos;

	// 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);

	// Find the middle of the foodspace.
	xPos = (foodSpace.getSizeX())/2;
	yPos = (foodSpace.getSizeY())/2;

	// Create a single SimpleBug, abug, and place it in the
	// foodspace at (xPos, yPos).  The bug knows the size of its
	// world from being passed the pointer to the foodspace in
	// which it is to be created.
	abug = new SimpleBug(Globals.env.globalZone, foodSpace, 
			     xPos, yPos, 1);

	return this;
    }

    // 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 tell it to send a
	// randomWalk message to abug.  Since the
	// createActionTo$message() method requires a selector ojbect to
	// "contain" the method, and since the creation of a selector
	// can throw an exception, that process is included in a
	// try/catch block. The first argument, abug.getClass(),
	// retrieves the class to which abug belongs while the second
	// argument, "randomWalk", is the name of the particular abug
	// method we wish to add to the list of actions.  Note that
	// randomWalk must have been declared public.
	modelActions = new ActionGroupImpl(getZone());
	try
	    {
	    sel = new Selector(abug.getClass(), "randomWalk", false);
	    modelActions.createActionTo$message(abug, sel);
	    } catch (Exception e)
		{
		System.err.println("Exception randomWalk: " + 
				   e.getMessage ());
		System.exit(1);
		}

	// Next we add to modelActions another message, this one to
	// modelSwarm itself telling it to check the simulation
	// time. We use this to send a timestamp to the console and to
	// stop the model after a specified number of periods.
	try
	    {
	    sel = new Selector(this.getClass(), "checkTime", false);
	    modelActions.createActionTo$message(this, sel);
	    } catch (Exception e)
		{
		System.err.println("Exception checkTime " + e.getMessage ());
		System.exit(1);
		}

	// 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 send a message to the console and terminate
    // the current activity.  We also use this method to send a
    // timestamp to the console.
    public void checkTime()
    {
	int i, t;
	int interval = 5;

	if (Globals.env.getCurrentTime() >= endTime)
	    {
	    // Terminate the simulation.
	    System.out.println("We've reached our endTime at period " + 
			       Globals.env.getCurrentTime());
	    Globals.env.getCurrentSwarmActivity().terminate();
	    }
	else
	    {
		for (i = 0; (t = (int)Math.pow(interval, (double)i)) 
			                               <= endTime; i++)
		    if (t == Globals.env.getCurrentTime())
			System.out.println("It's time " + t);
	    }

        return;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人三级小说| 国产成人av福利| 久久精品国产亚洲一区二区三区| 国产精品一区二区无线| 色噜噜狠狠成人中文综合| 日韩视频免费直播| 亚洲精品伦理在线| 国产成人午夜精品影院观看视频 | 香蕉成人伊视频在线观看| 国产精品一区一区三区| 日韩一区二区电影| 亚洲精品高清在线观看| 99视频在线观看一区三区| 2014亚洲片线观看视频免费| 丝瓜av网站精品一区二区| 97aⅴ精品视频一二三区| 欧美激情一区不卡| 国产乱人伦偷精品视频免下载| 337p亚洲精品色噜噜狠狠| 一区二区国产盗摄色噜噜| 成人av资源在线| 久久精品夜色噜噜亚洲a∨| 久久99精品国产91久久来源| 欧美人狂配大交3d怪物一区| 亚洲第一福利一区| 欧美日韩在线直播| 免费观看在线色综合| 一本到高清视频免费精品| 国产精品免费人成网站| 国产成人aaa| 国产精品国产自产拍在线| 不卡一区二区三区四区| 国产精品视频九色porn| 懂色一区二区三区免费观看| 国产婷婷色一区二区三区四区| 精品一区二区影视| 久久久久国产精品麻豆ai换脸| 国产一区日韩二区欧美三区| 久久影院电视剧免费观看| 国产成人免费视频一区| 国产精品久久免费看| hitomi一区二区三区精品| 国产精品久久夜| 日本道色综合久久| 一区二区高清在线| 欧美二区三区91| 加勒比av一区二区| 国产精品国产三级国产普通话三级 | 无码av中文一区二区三区桃花岛| 欧美日韩在线综合| 精品中文字幕一区二区小辣椒| 久久久久久久久久久久久女国产乱| 国产高清在线精品| 亚洲综合色噜噜狠狠| 欧美日韩高清一区二区三区| 国产制服丝袜一区| 国产精品久久久久久福利一牛影视| 91视频xxxx| 久久天天做天天爱综合色| 国产+成+人+亚洲欧洲自线| 亚洲欧美区自拍先锋| 欧美午夜精品一区二区蜜桃| 蜜桃视频一区二区| 国产精品免费av| 欧美丰满少妇xxxxx高潮对白| 久久精品国产99国产精品| 1000精品久久久久久久久| 欧美日本韩国一区| 国产高清久久久| 日日夜夜精品视频免费| 日本一区二区三区视频视频| 欧美少妇xxx| 国产成人av电影在线| 日韩精品电影一区亚洲| 中文字幕永久在线不卡| 91精品国产品国语在线不卡| 成人黄页毛片网站| 理论片日本一区| 一区二区国产视频| 中文成人av在线| 精品剧情v国产在线观看在线| 91丨九色丨国产丨porny| 久久99深爱久久99精品| 亚洲123区在线观看| 国产精品久久毛片a| 精品日韩成人av| 欧美裸体一区二区三区| 波多野洁衣一区| 国产一区二区三区观看| 日韩av午夜在线观看| 1000部国产精品成人观看| 国产午夜精品福利| 日韩一级大片在线观看| 欧美系列日韩一区| 日本二三区不卡| 99re在线精品| 成人精品鲁一区一区二区| 奇米影视7777精品一区二区| 一区二区高清视频在线观看| 日韩伦理av电影| 国产欧美日韩另类视频免费观看| 日韩免费高清视频| 欧美一级片免费看| 91.成人天堂一区| 91精品国产综合久久久蜜臀图片 | ●精品国产综合乱码久久久久| 国产日产欧产精品推荐色 | 成人性生交大片免费看中文| 精品中文字幕一区二区| 精品无人码麻豆乱码1区2区| 久久精品国产第一区二区三区| 日本中文字幕一区| 蜜桃久久久久久久| 狠狠色狠狠色综合系列| 黄色成人免费在线| 国内成人精品2018免费看| 老司机午夜精品| 韩国av一区二区三区四区| 久久99精品久久久久婷婷| 国产中文字幕一区| 岛国一区二区在线观看| 成人综合婷婷国产精品久久蜜臀| 丰满白嫩尤物一区二区| 91亚洲精华国产精华精华液| 91影视在线播放| 欧美视频一区二区在线观看| 欧美二区三区91| 久久先锋影音av鲁色资源| 国产日韩影视精品| 亚洲日韩欧美一区二区在线| 一区二区三区精品在线观看| 视频一区二区三区中文字幕| 久久精品国产亚洲高清剧情介绍 | 亚洲成人免费影院| 久久机这里只有精品| 国产成人无遮挡在线视频| 成人国产亚洲欧美成人综合网| 91麻豆免费视频| 91麻豆精品国产91久久久使用方法 | 国产人成一区二区三区影院| 国产精品三级av在线播放| 一区二区三区色| 日韩va欧美va亚洲va久久| 国产精品小仙女| 在线免费视频一区二区| 日韩欧美区一区二| 国产精品美女久久福利网站| 亚洲成人黄色小说| 国产老女人精品毛片久久| 一本大道久久a久久综合婷婷| 欧美精品高清视频| 国产精品美女www爽爽爽| 亚洲国产中文字幕在线视频综合| 国内外成人在线视频| 色婷婷激情一区二区三区| 日韩一区和二区| 亚洲欧美一区二区久久| 精品一区二区三区免费播放| 99精品国产热久久91蜜凸| 日韩一区二区三区av| 亚洲日本成人在线观看| 精品在线一区二区| 在线看国产一区二区| 26uuu精品一区二区| 午夜激情久久久| 色一区在线观看| 国产欧美一区二区三区鸳鸯浴| 五月激情六月综合| 99国产精品久久久久久久久久| 91精品综合久久久久久| 日韩一区在线免费观看| 激情久久五月天| 91精品在线观看入口| 一区二区三区四区在线| 国产91精品欧美| 久久蜜桃一区二区| 蜜臀a∨国产成人精品| 欧美综合视频在线观看| 国产精品久久久久久久久晋中| 另类小说一区二区三区| 欧美久久久久久久久| 一区二区三区欧美日韩| av不卡一区二区三区| 国产日韩欧美制服另类| 国产一区中文字幕| 欧美电影免费提供在线观看| 日韩电影在线一区二区| 欧美色图免费看| 亚洲国产成人porn| 欧美专区亚洲专区| 一区二区三区在线不卡| 一本一道综合狠狠老| 1区2区3区欧美| www.欧美日韩| 综合久久久久久| 成人app网站| 一区在线中文字幕| 91视频一区二区| 一区二区成人在线视频| 欧美午夜精品一区|