資源簡介
東南大學Robocup救援仿真國際賽代碼

代碼片段和文件信息
package?seu;
import?java.io.IOException;
import?rescuecore2.Constants;
import?rescuecore2.components.ComponentConnectionException;
import?rescuecore2.components.ComponentLauncher;
import?rescuecore2.components.TCPComponentLauncher;
import?rescuecore2.config.Config;
import?rescuecore2.config.ConfigException;
import?rescuecore2.connection.ConnectionException;
import?rescuecore2.misc.CommandLineOptions;
import?rescuecore2.registry.Registry;
import?rescuecore2.standard.entities.StandardEntityFactory;
import?rescuecore2.standard.entities.StandardPropertyFactory;
import?rescuecore2.standard.messages.StandardMessageFactory;
import?seu.agent.Ambulance.SEUAmbulanceCentre;
import?seu.agent.Ambulance.SEUAmbulanceTeam;
import?seu.agent.Firebrigade.SEUFireBrigade;
import?seu.agent.Firebrigade.SEUFireStation;
import?seu.agent.Police.SEUPoliceForce;
import?seu.agent.Police.SEUPoliceOffice;
/**
?*?Launch?SEU‘s?Agents
?*/
public?final?class?Main?{
private?static?final?String?RANDOM_SEED?=?“122“;
//?Rule?中規定的智能體最大數量
private?static?final?int?maxAgent?=?30;
private?static?final?int?maxCentre?=?5;
private?Main()?{
}
/**
?*?@param?啟動參數的定義如下
?*????????????-p??-h??-fb??-pf? ?*????????????forces>?-at?
?*/
public?static?void?main(String[]?args)?{
try?{
Registry.SYSTEM_REGISTRY
.registerEntityFactory(StandardEntityFactory.INSTANCE);
Registry.SYSTEM_REGISTRY
.registerMessageFactory(StandardMessageFactory.INSTANCE);
Registry.SYSTEM_REGISTRY
.registerPropertyFactory(StandardPropertyFactory.INSTANCE);
Config?config?=?new?Config();
args?=?CommandLineOptions.processArgs(args?config);
//?Keep
config.setValue(Constants.RANDOM_SEED_KEY?RANDOM_SEED);
int?port?=?config.getIntValue(Constants.KERNEL_PORT_NUMBER_KEY
Constants.DEFAULT_KERNEL_PORT_NUMBER);
String?defaultHost?=?config.getValue(
Constants.KERNEL_HOST_NAME_KEY
Constants.DEFAULT_KERNEL_HOST_NAME);
int?fb?=?-1;
int?fs?=?-1;
int?pf?=?-1;
int?po?=?-1;
int?at?=?-1;
int?ac?=?-1;
fb?=?(args[0].equals(“-1“))???maxAgent?:?Integer.parseInt(args[0]);
fs?=?(args[1].equals(“-1“))???maxCentre?:?Integer.parseInt(args[1]);
pf?=?(args[2].equals(“-1“))???maxAgent?:?Integer.parseInt(args[2]);
po?=?(args[3].equals(“-1“))???maxCentre?:?Integer.parseInt(args[3]);
at?=?(args[4].equals(“-1“))???maxAgent?:?Integer.parseInt(args[4]);
ac?=?(args[5].equals(“-1“))???maxCentre?:?Integer.parseInt(args[5]);
String?host?=?(args[6].equals(“-1“))???defaultHost?:?args[6];
ComponentLauncher?launcher?=?new?TCPComponentLauncher(host?port
config);
//?建立連接
connect(launcher?fb?fs?pf?po?at?ac?config);
}?catch?(IOException?e)?{
e.printStackTrace();
}?catch?(ConfigException?e)?{
e.printStackTrace();
}?catch?(ConnectionException?e)?{
e.printStackTrace();
}?catch?(InterruptedException?e)?{
e.printStackTrace();
}
}
private?static?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-02-22?19:36??SEU_RedSun\
?????目錄???????????0??2014-02-22?19:36??SEU_RedSun\.hg\
?????文件??????????57??2014-02-22?19:33??SEU_RedSun\.hg\00changelog.i
?????文件??????????93??2014-02-22?19:33??SEU_RedSun\.hg\branchheads.cache
?????文件????????8843??2014-02-22?19:33??SEU_RedSun\.hg\dirstate
?????文件?????????132??2014-02-22?19:33??SEU_RedSun\.hg\hgrc
?????文件??????????36??2014-02-22?19:33??SEU_RedSun\.hg\last-message.txt
?????文件??????????15??2014-02-22?19:33??SEU_RedSun\.hg\requires
?????目錄???????????0??2014-02-22?19:36??SEU_RedSun\.hg\store\
?????文件????????3597??2014-02-22?19:33??SEU_RedSun\.hg\store\00changelog.i
?????文件????????8065??2014-02-22?19:33??SEU_RedSun\.hg\store\00manifest.i
?????目錄???????????0??2014-02-22?19:36??SEU_RedSun\.hg\store\data\
?????文件?????????140??2014-02-22?19:33??SEU_RedSun\.hg\store\data\delete.sh.i
?????目錄???????????0??2014-02-22?19:36??SEU_RedSun\.hg\store\data\lib\
?????文件???????14865??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\jsi-1.0b2p1.jar.i
?????文件??????356990??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\log4j-1.2.15.jar.d
?????文件??????????64??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\log4j-1.2.15.jar.i
?????文件??????294065??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\rescuecore2.jar.d
?????文件??????????64??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\rescuecore2.jar.i
?????文件??????414208??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\standard.jar.d
?????文件??????????64??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\standard.jar.i
?????文件??????286976??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\trove-0.1.8.jar.d
?????文件??????????64??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\trove-0.1.8.jar.i
?????文件???????41097??2014-02-22?19:34??SEU_RedSun\.hg\store\data\lib\uncommons-maths-1.2.1.jar.i
?????文件?????????399??2014-02-22?19:33??SEU_RedSun\.hg\store\data\makefile.i
?????目錄???????????0??2014-02-22?19:36??SEU_RedSun\.hg\store\data\nodecache\
?????文件??????202840??2014-02-22?19:34??SEU_RedSun\.hg\store\data\nodecache\18700012287.nc.d
?????文件??????????64??2014-02-22?19:35??SEU_RedSun\.hg\store\data\nodecache\18700012287.nc.i
?????文件??????106373??2014-02-22?19:35??SEU_RedSun\.hg\store\data\nodecache\2182346507.nc.i
?????文件??????106833??2014-02-22?19:35??SEU_RedSun\.hg\store\data\nodecache\2184984835.nc.i
?????文件????????2499??2014-02-22?19:35??SEU_RedSun\.hg\store\data\nodecache\30934440.nc.i
............此處省略984個文件信息
評論
共有 條評論