Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
1e788ceaa59b61d34a4d054e9bcf94e4fa2de35c
[simgrid.git] / examples / java / energy / vm / Main.java
1 /* Copyright (c) 2016-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 package energy.vm;
7
8 import org.simgrid.msg.Host;
9 import org.simgrid.msg.HostNotFoundException;
10 import org.simgrid.msg.Msg;
11
12 class Main {
13   private Main() {
14     throw new IllegalAccessError("Utility class");
15   }
16
17   public static void main(String[] args) throws HostNotFoundException {
18     Msg.energyInit();
19     Msg.init(args);
20
21     if (args.length < 1) {
22       Msg.info("Usage: Main ../platforms/energy_platform_file.xml");
23       System.exit(1);
24     }
25
26     /* construct the platform */
27     Msg.createEnvironment(args[0]);
28
29     /* Create and start a runner for the experiment */
30     new EnergyVMRunner(Host.all()[0],"energy VM runner",null).start();
31
32     Msg.run();
33   }
34 }