Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a naive vm energy example - Ad(rien)
[simgrid.git] / examples / java / cloud / energy / Main.java
1 /* Copyright (c) 2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 //package cloud.energy;
8
9 import org.simgrid.msg.Host;
10 import org.simgrid.msg.HostNotFoundException;
11 import org.simgrid.msg.Msg;
12 import org.simgrid.msg.NativeException;
13
14 public class Main {
15     private static boolean endOfTest = false;
16
17     public static void setEndOfTest(){
18         endOfTest=true;
19     }
20
21     public static boolean isEndOfTest(){
22         return endOfTest;
23     }
24
25     public static void main(String[] args) throws NativeException {
26        /* Init. internal values */
27         Msg.energyInit();
28         Msg.init(args);
29
30         if (args.length < 1) {
31             Msg.info("Usage  : Main platform_file.xml deployment_file.xml");
32             System.exit(1);
33         }
34
35        /* construct the platform and deploy the application */
36         Msg.createEnvironment(args[0]);
37         Msg.deployApplication(args[1]);
38
39         Msg.run();
40
41     }
42 }