1 package at.ac.tuwien.lsdc.federation;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
6 import at.ac.tuwien.lsdc.sched.SchedulerB;
7 import at.ac.tuwien.lsdc.types.Application;
10 * Cloudpartners management. Class to be used to ask cloudpartners to take one
11 * of our APPs over to their infrastructure.
16 public class Federation {
20 private static final Logger LOG = LoggerFactory.getLogger(SchedulerB.class);
22 private int numPartners;
23 public final static int fak = 100;
24 public final static int th = 30;
26 public Federation(int numPartners) {
27 this.numPartners = numPartners;
31 * Try to outsource app.
34 * Application to outsource.
35 * @return true, if application can be outsourced.
37 public boolean askToOutsource(Application app) {
38 LOG.info("askToOutsource():" + app);
39 for (int i = 0; i < numPartners; i++) {
40 if (Math.random() * fak < th)