test en cours, pas fini
This commit is contained in:
@@ -3,11 +3,13 @@ package impl;
|
||||
import interfaces.CapteurAsync;
|
||||
import interfaces.ObserverdeCapteur;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
public class Afficheur implements ObserverdeCapteur {
|
||||
private int id= new Random().nextInt(100);
|
||||
public ArrayList<Integer> vals = new ArrayList();
|
||||
|
||||
public Afficheur() {}
|
||||
|
||||
@@ -22,6 +24,7 @@ public class Afficheur implements ObserverdeCapteur {
|
||||
Future<Integer> futureValue= capteurAsync.getValue();
|
||||
Integer value=futureValue.get();
|
||||
System.out.println("Afficheur " + id+", value: "+ value);
|
||||
vals.add(value);
|
||||
}catch(Exception e){
|
||||
//TODO
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -36,6 +36,6 @@ public class DiffusionAtomique implements AlgoDiffusion {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
capteur.unlock(); //TODO
|
||||
capteur.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ public class Scheduler {
|
||||
private final ScheduledExecutorService scheduler;
|
||||
|
||||
public Scheduler(int nbCanaux) {
|
||||
int nThread = 2+2*nbCanaux;
|
||||
int nThread = 20+2*nbCanaux;
|
||||
scheduler = Executors.newScheduledThreadPool(nThread);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user