本文整理汇总了Java中com.esotericsoftware.minlog.Log.set方法的典型用法代码示例。如果您正苦于以下问题:Java Log.set方法的具体用法?Java Log.set怎么用?Java Log.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esotericsoftware.minlog.Log
的用法示例。
在下文中一共展示了Log.set方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
Log.set(com.esotericsoftware.minlog.Log.LEVEL_INFO);
avoidTheLine(100,
Paths.get("inputs","paper_synthesis"),
Paths.get("runs","paper_synthesis"));
/*
thresholdSweeps(25,
Paths.get("inputs","paper_synthesis"),
Paths.get("runs","paper_synthesis")
);
thresholdProbabilitySweeps(25,
Paths.get("inputs","paper_synthesis"),
Paths.get("runs","paper_synthesis")
);
socialAnnealing(25,
Paths.get("inputs","paper_synthesis"),
Paths.get("runs","paper_synthesis")
);
*/
}
示例2: setUp
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
Log.set(Log.LEVEL_INFO);
factory = new MultiQuotaMapFactory();
factory.getInitialQuotas().put("First",1000d);
factory.getInitialQuotas().put("Third",10d);
state = mock(FishState.class,RETURNS_DEEP_STUBS);
biology = new GlobalBiology(new Species("First"),new Species("Second"),new Species("third"));
when(state.getBiology()).thenReturn(biology);
when(state.getRandom()).thenReturn(new MersenneTwisterFast());
when(state.getSpecies()).thenReturn(biology.getSpecies());
when(state.getNumberOfFishers()).thenReturn(100);
}
示例3: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
JDialog scenarioSelection = new JDialog((JFrame)null,true);
final ScenarioJComponent scenario = new ScenarioJComponent(new HabitatDeploymentScenario());
final JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(new JScrollPane(scenario.getJComponent()), BorderLayout.CENTER);
//create ok and exit button
Box buttonBox = new Box( BoxLayout.LINE_AXIS);
contentPane.add(buttonBox, BorderLayout.SOUTH);
final JButton ok = new JButton("OK");
ok.addActionListener(e -> scenarioSelection.dispatchEvent(new WindowEvent(
scenarioSelection,WindowEvent.WINDOW_CLOSING
)));
buttonBox.add(ok);
final JButton cancel = new JButton("Cancel");
cancel.addActionListener(e -> System.exit(0));
buttonBox.add(cancel);
scenarioSelection.setContentPane(contentPane);
scenarioSelection.pack();
scenarioSelection.setVisible(true);
FishState state = new FishState(System.currentTimeMillis(),1);
Log.set(Log.LEVEL_NONE);
Log.setLogger(new FishStateLogger(state, Paths.get("log.csv")));
state.setScenario(scenario.getScenario());
HabitatDeployment vid = new HabitatDeployment(state);
vid.getPolicyButtons().add(new GearSetterButton());
Console c = new Console(vid);
c.setSize(1000, 600);
c.setVisible(true);
}
示例4: stepsItTookErotetic
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static int stepsItTookErotetic(
int maxSteps,
final long seed,
final boolean adaptive) {
Log.set(Log.LEVEL_INFO);
PrototypeScenario scenario = new PrototypeScenario();
scenario.setBiologyInitializer(new IndependentLogisticFactory()); //skip migration which should make this faster.
scenario.setFishers(300);
if(adaptive)
scenario.setDestinationStrategy(new BetterThanAverageEroteticDestinationFactory());
else {
ThresholdEroteticDestinationFactory plainThreshold = new ThresholdEroteticDestinationFactory();
plainThreshold.setProfitThreshold(new FixedDoubleParameter(0d));
scenario.setDestinationStrategy(plainThreshold);
}
FishState state = new FishState(seed, 1);
state.setScenario(scenario);
state.start();
Species onlySpecies = state.getBiology().getSpecie(0);
final double minimumBiomass = state.getTotalBiomass(
onlySpecies) * .1; //how much does it take to eat 90% of all the fish?
int steps;
for (steps = 0; steps < maxSteps; steps++) {
state.schedule.step(state);
if (state.getTotalBiomass(onlySpecies) <= minimumBiomass)
break;
}
// System.out.println(steps + " -- " + state.getTotalBiomass(onlySpecies));
return steps;
}
示例5: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void main (String[] args) throws IOException {
System.out.println("FYHUJBVGYVUHJKLJVCTYFUGHIJKNJHCFGIJOLMKNJHGCGIHJOPKMLKNJ HGVYGUIHOJLMKN VGHJO");
Log.set(Log.LEVEL_DEBUG);
new TDServer();
}
示例6: create
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
@Override
public void create() {
Bullet.init();
themes.add("basic");
//clearPrefs();
//changePref("debug", true);
preferences = new PreferenceHandler();
dialogs = new Dialogs();
fonts = new HashMap<String, BitmapFont>();
FileHandler.loadFonts(fonts);
FileHandler.writeJSON(Gdx.files.external("Map.json"));
if(preferences.isDebug())
Gdx.app.setLogLevel(Application.LOG_DEBUG);
loadExternalAssets();
loadTheme("basic");
GameMode mode;
if(startingMode != null) {
try {
mode = GameMode.valueOf(startingMode);
Gdx.app.log("StartingMode", mode.name());
} catch (Exception e) {
Gdx.app.error("TDGalaxy", "Invalid starting mode", e);
}
}
if(preferences.isVr())
Gdx.graphics.setVSync(false);
mainScreen = new MainScreen(this);
setScreen(mainScreen);
//setScreen(new GameScreen(this, 0, themes.get(0)));
controlHandler = new ControlHandler();
client = new TDClient();
//client.connect(5000, "99.36.127.68", Networking.PORT); //99.36.127.68
Log.set(Log.LEVEL_DEBUG);
if(TDGalaxy.preferences.isDebugWindow() && debugger != null)
debugger.createWindow("Controllers");
if(vr != null && preferences.isVr()) {
vr.initialize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(),2560, 1440);
new Thread() {
@Override
public void run() {
}
}.start();
}
}
示例7: init
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* Initializes the client.
*/
public void init() {
Log.set(Log.LEVEL_NONE);
Kryo kryo = client.getKryo();
kryo.register(main.Game.class);
kryo.register(main.GridAI.class);
kryo.register(pawn.APawn.class);
kryo.register(pawn.APawn[].class);
kryo.register(pawn.APawn[][].class);
kryo.register(pawn.Bomb.class);
kryo.register(pawn.Captain.class);
kryo.register(pawn.Colonel.class);
kryo.register(pawn.Flag.class);
kryo.register(pawn.General.class);
kryo.register(pawn.Lake.class);
kryo.register(pawn.Lieutenant.class);
kryo.register(pawn.Major.class);
kryo.register(pawn.Marshal.class);
kryo.register(pawn.Miner.class);
kryo.register(pawn.NoPawn.class);
kryo.register(pawn.Scout.class);
kryo.register(pawn.Sergeant.class);
kryo.register(pawn.Spy.class);
kryo.register(java.util.Vector.class);
kryo.register(int[].class);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
if (this.local == false) {
askIp();
}
connect();
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
client.close();
}
});
this.setSize(450, 450);
this.setTitle("Client");
this.setVisible(true);
this.setLocationRelativeTo(null);
state();
}
示例8: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* @param args the command line arguments
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Log.set(Log.LEVEL_NONE);
IOManager.initialize(IOManager.CONSOLE);
IOManager.input();
}
示例9: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void main(String[] args) throws FileNotFoundException {
Log.set(Log.LEVEL_INFO);
FishYAML yaml = new FishYAML();
for (Map.Entry<String, Consumer<PrototypeScenario>> condition : conditions.entrySet())
{
for(int run=0; run<10; run++)
{
PrototypeScenario scenario = yaml.loadAs(
new FileReader(baseline.resolve("discards_base.yaml").toFile()),
PrototypeScenario.class
);
scenario.setFishers(NUMBER_OF_FISHERS);
condition.getValue().accept(scenario);
FishState state = new FishState(run);
state.setScenario(scenario);
state.start();
String name = condition.getKey() + "#"+run;
Log.info(name);
while (state.getYear()<20)
{
state.schedule.step(state);
}
//if(state.getYearlyDataSet().getColumn())
//if there is no ITQ, don't try to collect price data!
if(state.getYearlyDataSet().getColumn("ITQ Prices Of Species 0") == null)
FishStateUtilities.printCSVColumnsToFile(
baseline.resolve(name+".csv").toFile(),
state.getYearlyDataSet().getColumn("Species 0 Landings"),
state.getYearlyDataSet().getColumn("Species 1 Landings"),
state.getYearlyDataSet().getColumn("Species 0 Catches"),
state.getYearlyDataSet().getColumn("Species 1 Catches"),
state.getYearlyDataSet().getColumn("Average Cash-Flow"),
state.getYearlyDataSet().getColumn("Total Effort"),
state.getYearlyDataSet().getColumn("Biomass Species 0"),
state.getYearlyDataSet().getColumn("Biomass Species 1")
);
else
FishStateUtilities.printCSVColumnsToFile(
baseline.resolve(name+".csv").toFile(),
state.getYearlyDataSet().getColumn("Species 0 Landings"),
state.getYearlyDataSet().getColumn("Species 1 Landings"),
state.getYearlyDataSet().getColumn("Species 0 Catches"),
state.getYearlyDataSet().getColumn("Species 1 Catches"),
state.getYearlyDataSet().getColumn("Average Cash-Flow"),
state.getYearlyDataSet().getColumn("Total Effort"),
state.getYearlyDataSet().getColumn("Biomass Species 0"),
state.getYearlyDataSet().getColumn("Biomass Species 1"),
state.getYearlyDataSet().getColumn("ITQ Volume Of Species 0"),
state.getYearlyDataSet().getColumn("ITQ Volume Of Species 1"),
state.getYearlyDataSet().getColumn("ITQ Prices Of Species 0"),
state.getYearlyDataSet().getColumn("ITQ Prices Of Species 1")
);
}
}
}
示例10: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void main(String[] args) throws FileNotFoundException
{
Log.set(Log.LEVEL_INFO);
for(long run = SEED; run < SEED + NUMBER_OF_RUNS; run++) {
for (Map.Entry<String, Path> scenario : scenarios.entrySet()) {
FishYAML yaml = new FishYAML();
PrototypeScenario scenario1 = yaml.loadAs(
new FileReader(scenario.getValue().toFile()), PrototypeScenario.class
);
FishState state = new FishState(run);
state.setScenario(scenario1);
state.start();
while (state.getYear() < 20)
state.schedule.step(state);
Log.info(scenario.getKey() + " " + run);
FishStateUtilities.printCSVColumnsToFile(
outputFolder.resolve(scenario.getKey() +"_"+ run + ".csv").toFile(),
state.getYearlyDataSet().getColumn("Species 0 Landings"),
state.getYearlyDataSet().getColumn("Species 1 Landings"),
state.getYearlyDataSet().getColumn("Species 0 Recruitment"),
state.getYearlyDataSet().getColumn("Species 1 Recruitment"),
state.getYearlyDataSet().getColumn("Average Cash-Flow"),
state.getYearlyDataSet().getColumn("Total Effort"),
state.getYearlyDataSet().getColumn("Biomass Species 0"),
state.getYearlyDataSet().getColumn("Biomass Species 1")
);
double score = 0;
for (double landings : state.getYearlyDataSet().getColumn("Species 0 Landings"))
score += landings;
score += state.getYearlyDataSet().getColumn("Biomass Species 1").getLatest();
Log.info("score: " + score);
}
}
}
示例11: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
/**
* go from 300 fishers back to 0 immediately
*/
public static void main(String[] args)
{
FishState state = new FishState(System.currentTimeMillis());
Log.set(Log.LEVEL_NONE);
PrototypeScenario scenario = new PrototypeScenario();
scenario.setFishers(50);
//lspiRun the model for a full 3 years before progressing
state.setScenario(scenario);
state.start();
while(state.getYear()<3)
state.schedule.step(state);
//now keep running for 10 years adding 5 fishers every month
while(state.getYear()<13)
{
if (state.getDayOfTheYear() % 30 == 0)
{
state.createFisher();
state.createFisher();
state.createFisher();
state.createFisher();
state.createFisher();
}
state.schedule.step(state);
}
//for the next 10 years remove the fishers
while(state.getYear()<23)
{
while (state.getFishers().size() > 0)
{
state.killRandomFisher();
}
state.schedule.step(state);
}
Path container = Paths.get("runs", "entry-exit");
container.toFile().mkdirs();
FishStateUtilities.printCSVColumnsToFile(container.resolve("sample2.csv").toFile(),
state.getDailyDataSet().getColumn("Number of Fishers"),
state.getDailyDataSet().getColumn("Species 0 Landings"),
state.getDailyDataSet().getColumn("Biomass Species 0")
);
}
示例12: slowInSlowOut
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void slowInSlowOut(String[] args)
{
FishState state = new FishState(System.currentTimeMillis());
Log.set(Log.LEVEL_NONE);
PrototypeScenario scenario = new PrototypeScenario();
scenario.setFishers(50);
//lspiRun the model for a full 3 years before progressing
state.setScenario(scenario);
state.start();
while(state.getYear()<3)
state.schedule.step(state);
//now keep running for 10 years adding 5 fishers every month
while(state.getYear()<13)
{
if (state.getDayOfTheYear() % 30 == 0)
{
state.createFisher();
state.createFisher();
// state.createFisher();
// state.createFisher();
// state.createFisher();
}
state.schedule.step(state);
}
//for the next 10 years remove the fishers
while(state.getYear()<23)
{
if (state.getDayOfTheYear() % 30 == 0)
{
state.killRandomFisher();
state.killRandomFisher();
// state.killRandomFisher();
// state.killRandomFisher();
// state.killRandomFisher();
}
state.schedule.step(state);
}
Path container = Paths.get("runs", "entry-exit");
container.toFile().mkdirs();
FishStateUtilities.printCSVColumnsToFile(container.resolve("sample.csv").toFile(),
state.getDailyDataSet().getColumn("Number of Fishers"),
state.getDailyDataSet().getColumn("Species 0 Landings"),
state.getDailyDataSet().getColumn("Biomass Species 0")
);
}
示例13: main
import com.esotericsoftware.minlog.Log; //导入方法依赖的package包/类
public static void main(String[] args) throws FileNotFoundException {
Log.set(Log.LEVEL_INFO);
for (long run = SEED; run < SEED + NUMBER_OF_RUNS; run++) {
for (Map.Entry<String, Path> scenario : scenarios.entrySet()) {
FishYAML yaml = new FishYAML();
PrototypeScenario scenario1 = yaml.loadAs(
new FileReader(scenario.getValue().toFile()), PrototypeScenario.class
);
FishState state = new FishState(run);
state.setScenario(scenario1);
state.start();
while (state.getYear() < 20)
state.schedule.step(state);
Log.info(scenario.getKey() + " " + run);
FishStateUtilities.printCSVColumnsToFile(
outputFolder.resolve(scenario.getKey() + "_" + run + ".csv").toFile(),
state.getYearlyDataSet().getColumn("Species 0 Landings"),
state.getYearlyDataSet().getColumn("Species 1 Landings"),
state.getYearlyDataSet().getColumn("Species 0 Recruitment"),
state.getYearlyDataSet().getColumn("Species 1 Recruitment"),
state.getYearlyDataSet().getColumn("Average Cash-Flow"),
state.getYearlyDataSet().getColumn("Total Effort"),
state.getYearlyDataSet().getColumn("Biomass Species 0"),
state.getYearlyDataSet().getColumn("Biomass Species 1")
);
double score = 0;
for (double landings : state.getYearlyDataSet().getColumn("Species 0 Landings"))
score += landings;
score += state.getYearlyDataSet().getColumn("Biomass Species 1").getLatest();
Log.info("score: " + score);
}
}
}