Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add option smpi/privatize-lib to add extra library to privatization.
[simgrid.git] / examples / java / energy / consumption / Main.java
1 /* Copyright (c) 2012-2018. 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 energy.consumption;
8
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.MsgException;
11
12 public class Main {
13   private Main() {
14     throw new IllegalAccessError("Utility class");
15   }
16
17   public static void main(String[] args) throws MsgException {  
18     Msg.energyInit(); 
19     Msg.init(args); 
20
21     if (args.length < 1) {
22       Msg.info("Usage   : Energy platform_file");
23       Msg.info("Usage  : Energy ../platforms/energy_platform.xml");
24       System.exit(1);
25     }
26     /* Construct the platform */
27     Msg.createEnvironment(args[0]);
28     /* Instantiate a process */
29     new EnergyConsumer("MyHost1","energyConsumer").start();
30     /* Execute the simulation */
31     Msg.run();
32     Msg.info("Total simulation time: "+  Msg.getClock());
33   }
34 }