Logo AND Algorithmique Numérique Distribuée

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