当前位置: 首页>>代码示例>>Java>>正文


Java Log.set方法代码示例

本文整理汇总了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")
        );
        */

    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:27,代码来源:SynthesisPaper.java

示例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);

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:17,代码来源:MultiQuotaMapFactoryTest.java

示例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);
    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:41,代码来源:HabitatDeployment.java

示例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;


}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:38,代码来源:BetterThanAverageEroteticDestinationFactoryTest.java

示例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();
}
 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:6,代码来源:TDServer.java

示例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();
       }
   }
 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:56,代码来源:TDGalaxy.java

示例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();

}
 
开发者ID:elmimille6,项目名称:projetba1,代码行数:46,代码来源:StratClient.java

示例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();
}
 
开发者ID:jaaimino,项目名称:text-dungeon,代码行数:10,代码来源:TextDungeon.java

示例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")
                    );




            }

        }





    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:77,代码来源:DiscardExperiment.java

示例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);
        }
    }


}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:45,代码来源:KitchenSinkHalfComparison.java

示例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")
    );

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:51,代码来源:LinearIncreaseInFishers.java

示例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")
                                             );

}
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:52,代码来源:LinearIncreaseInFishers.java

示例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);
            }
        }
    }
 
开发者ID:CarrKnight,项目名称:POSEIDON,代码行数:42,代码来源:TacMixedKitchenSinkComparison.java


注:本文中的com.esotericsoftware.minlog.Log.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。