Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add java surf plugin to reserve bandwidth
[simgrid.git] / examples / java / reservationSurfPlugin / Receiver.java
1 /* Copyright (c) 2006-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 reservationSurfPlugin;
8 import org.simgrid.msg.Host;
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.MsgException;
11 import org.simgrid.msg.Task;
12 import org.simgrid.msg.Process;
13
14 public class Receiver extends Process {
15    public Receiver(Host host, String name, String[]args) {
16                 super(host,name,args);
17    }
18    final double commSizeLat = 1;
19    final double commSizeBw = 100000000;
20
21    public void main(String[] args) throws MsgException {
22
23       Msg.info("helloo!");
24       double communicationTime=0;
25
26       Msg.info("try to get a task");
27
28       Task task = Task.receive(getHost().getName());
29       double timeGot = Msg.getClock();
30
31       Msg.info("Got at time "+ timeGot);
32       task.execute();
33
34       Msg.info("goodbye!");
35     }
36 }