algod
Class Sommet

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--algod.SommetAbstract
              |
              +--algod.SommetIO
                    |
                    +--algod.SommetElection
                          |
                          +--algod.SommetArbreCouvrant
                                |
                                +--algod.SommetNumProfondeur
                                      |
                                      +--algod.SommetColoration
                                            |
                                            +--algod.SommetColorationAsynch1
                                                  |
                                                  +--algod.Sommet
All Implemented Interfaces:
java.lang.Runnable, SommetInterface

public final class Sommet
extends SommetColorationAsynch1
implements SommetInterface

Défini pour un sommet les méthodes propres aux threads. Sommet complètement défini.

Version:
1.0
Author:
Alexandre Alapetite, Brice Andujar, Gregory Gontier

Field Summary
private  GrapheInterface arretNotify
          Contrôleur à prévenir lors de la destruction effective de ce Sommet(Thread).
(package private)  boolean tourne
          Indique si le thread est en cours d'exécution
 
Fields inherited from class algod.SommetColorationAsynch1
algoDMessageFIFO, backtrack_optimise, booleanVector, colorationAsynch1, couleur, couleurMax, identElu, identifiant, nbBackTrack, nbBackTrack_SJ, nbMessagesArbreCouvrant, nbMessagesColoration, nbMessagesColoration_SJ, nbMessagesElection, nbMessagesNumProfondeur, numVoisinParent, poids, poidsEnfants, rndDelaiTransmission, route, verbose, voisinsTrackConnus
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Sommet(int couleur, int identifiant)
           
 
Method Summary
 void arrete(GrapheInterface arretNotify)
          Arrête l'exécution du thread proprement.
 void destroy()
          Détruit le thread sans préavis.
 java.lang.String getLabel()
          Texte à afficher pour ce sommet.
 void run()
          Appelle les méthodes de démarrage parentes, puis boucle tant que tourne est vrai, en traitant les messages éventuellements en attente.
 java.lang.String toString()
          Informations sur ce sommet.
protected  void traiteReception(AlgoDMessage adm)
           
 
Methods inherited from class algod.SommetColorationAsynch1
acteCandidature, affiche, afficheErreur, ajoutVoisin, ajoutVoisin, attend, chercheRoutesBackTrack, demarreArbreCouvrant, demarreColoration, demarreElection, demarreNumProfondeur, envoyerABackTrack, envoyerABackTrackFini, envoyerAEnfant, envoyerAEnfantsPasTrack, envoyerAPere, envoyerASommet, envoyerASommet, envoyerATousVoisins, envoyerATousVoisinsSauf, envoyerATrack, envoyerAuxEnfants, envoyerAuxFaibles, envoyerAuxForts, envoyerAVoisin, envoyerAVoisin, finArbreCouvrant, finColoration, finElection, finNumProfondeur, getCouleur, getCouleurMaxPossible, getEnfant, getEnfantAt, getIdentifiant, getIdentifiantProfondeur, getPere, getVoisin, getVoisinAt, indexOfEnfant, initialisationElection, isCouleurOfficielle, isElu, isFeuille, isFilsDe, isFini, isRacine, isVoisin, nbEnfants, nbVoisins, numOfVoisin, recevoir, setCouleursVoisinsSupp, sonnerie, traiteReception
 
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, 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
 
Methods inherited from interface graphelastic.SommetInterface
getCouleur, getIdentifiant, isCouleurOfficielle, isElu, isFilsDe
 

Field Detail

tourne

boolean tourne
Indique si le thread est en cours d'exécution


arretNotify

private GrapheInterface arretNotify
Contrôleur à prévenir lors de la destruction effective de ce Sommet(Thread).

Constructor Detail

Sommet

public Sommet(int couleur,
              int identifiant)
Method Detail

destroy

public void destroy()
Détruit le thread sans préavis.

Overrides:
destroy in class SommetColoration
See Also:
arrete(algod.GrapheInterface)

arrete

public void arrete(GrapheInterface arretNotify)
Arrête l'exécution du thread proprement.
Il s'auto-détruira ensuite par l'appel de destroy()

See Also:
destroy()

run

public void run()
Appelle les méthodes de démarrage parentes, puis boucle tant que tourne est vrai, en traitant les messages éventuellements en attente.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
tourne, SommetIO.algoDMessageFIFO

getLabel

public java.lang.String getLabel()
Texte à afficher pour ce sommet.

Specified by:
getLabel in interface SommetInterface

traiteReception

protected void traiteReception(AlgoDMessage adm)

toString

public java.lang.String toString()
Description copied from class: SommetAbstract
Informations sur ce sommet.

Overrides:
toString in class SommetColoration
Returns:
un texte sur une ligne décrivant de sommet.