|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--algod.SommetAbstract | +--algod.SommetIO | +--algod.SommetElection | +--algod.SommetArbreCouvrant | +--algod.SommetNumProfondeur
Ajoute la fonctionnalité de numérotation en profondeur inversée de l'arbre couvrant.
Field Summary | |
protected AlgoDMessageFIFO |
algoDMessageFIFO
File d'attente des messages provenant d'autres sommets. |
(package private) int |
identElu
Identifiant du sommet élu. -1 si pas encore élu. |
protected int |
identifiant
Identifiant unique de ce sommet. |
private int |
identifiantProfondeur
Nouvel identifiant après l'arbre couvrant, qui correspond à une numérotation en profondeur inversée. |
(package private) static int |
nbMessagesArbreCouvrant
|
(package private) static int |
nbMessagesElection
|
(package private) static int |
nbMessagesNumProfondeur
|
(package private) int |
numVoisinParent
Numéro du voisin qui fait parent. |
protected int |
poids
Poids de ce noeud de l'arbre recouvrant, c'est-à-dire le nombre de sommets enfants et petit-enfants, etc... |
(package private) IntVector |
poidsEnfants
Tableau stoquant les poids des différents enfants. |
(package private) static int |
rndDelaiTransmission
|
(package private) IntVector |
route
Tableau indiquant, pour les sommets supposés du graphe, le voisin qui relaie la communication. |
static boolean |
verbose
Indique si un texte doit apparaître lors de certaines actions comme l'envoit de messages. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
SommetNumProfondeur(int identifiant)
|
Method Summary | |
(package private) void |
acteCandidature()
Démarre un acte de candidature. |
(package private) void |
affiche(java.lang.String texte)
Affiche du texte sur la sortie standard. |
(package private) void |
afficheErreur(java.lang.String texte)
Affiche du texte sur la sortie standard. |
protected int |
ajoutVoisin(AlgoDMessageFIFO aAlgoDMessageFIFO,
int aIdentifiant)
Ajoute un voisin à ce sommet. |
protected int |
ajoutVoisin(SommetVoisin unSommet)
Ajoute un voisin à ce sommet. |
(package private) void |
attend(long millis)
Attend un certain nombre de millisecondes. |
void |
demarreArbreCouvrant()
A appeler pour démarrer l'algorithme distribué d'arbre couvrant à partir de ce sommet. |
protected void |
demarreElection()
|
void |
demarreNumProfondeur()
|
void |
destroy()
Arrête le thread et nettoie ses structures et moyens de communication. |
void |
envoyerAEnfant(char typeMessage,
java.lang.String contenu,
int identSommetSource,
int numEnfant)
Envoie un message à un enfant. |
void |
envoyerAPere(char typeMessage,
java.lang.String contenu,
int identSommetSource)
Envoie un message au père de ce sommet dans l'arbre couvrant. |
(package private) void |
envoyerASommet(char typeMessage,
java.lang.String contenu,
int identSommetSource,
SommetVoisin sommetVoisin)
|
(package private) void |
envoyerASommet(char typeMessage,
java.lang.String contenu,
int identSommetSource,
SommetVoisin sommetVoisin,
int identSommetDestination)
|
protected void |
envoyerATousVoisins(char typeMessage,
java.lang.String contenu,
int identSommetSource)
Envoie un message à tous les voisins. |
protected void |
envoyerATousVoisinsSauf(char typeMessage,
java.lang.String contenu,
int identSommetSource,
int numVoisin)
Envoie un message à tous les voisins sauf un. |
void |
envoyerAuxEnfants(char typeMessage,
java.lang.String contenu,
int identSommetSource)
Envoie un message aux enfants de ce sommet dans l'arbre couvrant. |
protected void |
envoyerAVoisin(char typeMessage,
java.lang.String contenu,
int identSommetSource,
int numVoisin)
|
protected void |
envoyerAVoisin(char typeMessage,
java.lang.String contenu,
int identSommetSource,
int numVoisin,
int identSommetDestination)
Envoie un message de type typeMessage, provenant du sommet identSommetSource que l'on achemine par le voisin numVoisin pour le sommet identSommetDestination. |
protected void |
finArbreCouvrant()
Termine la méthode héritée de fin d'arbre couvrant pour démarrer la numérotation en profondeur. |
protected void |
finElection()
Termine la méthode héritée de fin d'élection pour démarrer l'arbre couvrant. |
protected void |
finNumProfondeur()
|
SommetVoisin |
getEnfant(int ident)
|
SommetVoisin |
getEnfantAt(int num)
|
int |
getIdentifiant()
Accès à l'identifiant de ce sommet. |
int |
getIdentifiantProfondeur()
Accés au nouvel identifiant après l'arbre couvrant, qui correspond à une numérotation en profondeur inversée. |
SommetVoisin |
getPere()
Accés au père de ce sommet. |
SommetVoisin |
getVoisin(int ident)
|
SommetVoisin |
getVoisinAt(int num)
|
int |
indexOfEnfant(int ident)
|
protected void |
initialisationElection(int nbSomm)
|
boolean |
isElu()
Retourne si ce sommet est l'élu de son groupe. |
boolean |
isFeuille()
Indique si ce sommet est une feuille de l'arbre couvrant. |
boolean |
isFilsDe(int idPere)
Indique si ce sommet est un fils du sommet de cet identifiant. |
boolean |
isFini()
Indique que le sommet n'a plus de message à traiter dans la file d'attente. |
boolean |
isRacine()
Indique si ce sommet est la racine de l'arbre couvrant. |
boolean |
isVoisin(int ident)
Teste si un sommet est voisin de celui-ci. |
int |
nbEnfants()
|
int |
nbVoisins()
|
int |
numOfVoisin(int ident)
|
private void |
receptionIdentifiantProfondeur(int numVoisin,
int idPr)
Récepetion par un voisin de son identifiant profondeur. |
private void |
receptionSetIdentifiantProfondeur(int idPr)
Réception de notre identifiant profondeur par notre père. |
void |
recevoir(AlgoDMessage adm)
Ajoute un message provenant d'un autre sommet à la file des messages. |
(package private) void |
sonnerie()
Fait un beep |
java.lang.String |
toString()
Informations sur ce sommet. |
protected void |
traiteReception(AlgoDMessage adm,
int numVoisin)
Appelle les méthodes appropriées en fonction du message à traiter aprés un parsage éventuel. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static int nbMessagesNumProfondeur
private int identifiantProfondeur
static int nbMessagesArbreCouvrant
int numVoisinParent
protected int poids
IntVector poidsEnfants
static int nbMessagesElection
IntVector route
int identElu
SommetElection.maxIdent
,
SommetElection.maxNbVoisins
static int rndDelaiTransmission
protected AlgoDMessageFIFO algoDMessageFIFO
public static boolean verbose
protected final int identifiant
Constructor Detail |
public SommetNumProfondeur(int identifiant)
Method Detail |
public final int getIdentifiantProfondeur()
public void demarreNumProfondeur()
protected void finNumProfondeur()
protected final void finArbreCouvrant()
finArbreCouvrant
in class SommetArbreCouvrant
protected void traiteReception(AlgoDMessage adm, int numVoisin)
SommetIO
traiteReception
in class SommetArbreCouvrant
private void receptionIdentifiantProfondeur(int numVoisin, int idPr)
private void receptionSetIdentifiantProfondeur(int idPr)
public java.lang.String toString()
SommetAbstract
toString
in class SommetArbreCouvrant
public void destroy()
SommetAbstract
destroy
in class SommetElection
public final boolean isRacine()
public final boolean isFeuille()
public final boolean isFilsDe(int idPere)
public final int nbEnfants()
public final SommetVoisin getEnfantAt(int num)
num
- le numéro de l'enfant auquel on veut avoir accés.
public final SommetVoisin getPere()
public final SommetVoisin getEnfant(int ident)
ident
- l'identifiant du sommet enfant auquel on veut avoir accés.
public int indexOfEnfant(int ident)
ident
- l'identifiant du sommet enfant auquel on veut avoir accés.
public void demarreArbreCouvrant()
protected final void finElection()
finElection
in class SommetElection
public void envoyerAPere(char typeMessage, java.lang.String contenu, int identSommetSource)
public void envoyerAuxEnfants(char typeMessage, java.lang.String contenu, int identSommetSource)
public void envoyerAEnfant(char typeMessage, java.lang.String contenu, int identSommetSource, int numEnfant)
numEnfant
- le n° de l'enfant voisin à qui ce message est destiné.protected void initialisationElection(int nbSomm)
protected int ajoutVoisin(SommetVoisin unSommet)
SommetAbstract
ajoutVoisin
in class SommetAbstract
public final boolean isElu()
protected void demarreElection()
final void acteCandidature()
final void envoyerASommet(char typeMessage, java.lang.String contenu, int identSommetSource, SommetVoisin sommetVoisin, int identSommetDestination)
final void envoyerASommet(char typeMessage, java.lang.String contenu, int identSommetSource, SommetVoisin sommetVoisin)
protected final void envoyerAVoisin(char typeMessage, java.lang.String contenu, int identSommetSource, int numVoisin, int identSommetDestination)
protected final void envoyerAVoisin(char typeMessage, java.lang.String contenu, int identSommetSource, int numVoisin)
protected final void envoyerATousVoisins(char typeMessage, java.lang.String contenu, int identSommetSource)
protected final void envoyerATousVoisinsSauf(char typeMessage, java.lang.String contenu, int identSommetSource, int numVoisin)
numVoisin
- le numéro du voisin à ignorer (pas son identifiant).public final boolean isFini()
public final void recevoir(AlgoDMessage adm)
SommetIO.algoDMessageFIFO
public final int getIdentifiant()
public final boolean isVoisin(int ident)
ident
- identifiant du sommet potentiellement voisin de celui-ci.
public final SommetVoisin getVoisinAt(int num)
num
- le numéro du voisin auquel on veut avoir accés.
public final SommetVoisin getVoisin(int ident)
ident
- l'identifiant du voisin auquel on veut avoir accés.
public final int numOfVoisin(int ident)
ident
- l'identifiant d'un sommet voisin de ce sommet.
public final int nbVoisins()
protected final int ajoutVoisin(AlgoDMessageFIFO aAlgoDMessageFIFO, int aIdentifiant)
void affiche(java.lang.String texte)
void afficheErreur(java.lang.String texte)
void sonnerie()
final void attend(long millis)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |