@startuml
'https://plantuml.com/class-diagram

skinparam style strictuml
skinparam classAttributeIconSize 0
skinparam classFontStyle Bold
skinparam roundcorner 20
hide enum methods

package "Diagramme de Classe de Conception V2 " <<Folder>> {
  interface AntFacadeController <<interface>> #pink ##[bold]red {
      +setParameters(evaporationParam:Integer,
      foodParam:Integer, pheromoneParam:Integer)
      +createGrid(width:Integer, height:Integer)
      +putObstacle(row:Integer, column:Integer)
      +putFood(row:Integer, column:Integer, quantity:Integer)
      +createColony(row:Integer, column:Integer)
      +createSoldiers(amount:Integer)
      +createWorkers(amount:Integer)
      +setAntFile(antLogFile:String)
      +play(duration:Integer, record:Boolean) : BitSet[][]
  }

  class Graphe #lightcoral;line.bold {
      -taille[*][*]: Integer
      -estObstacle[*][*]: Boolean
      -estNourriture[*][*]: Boolean
      -quantityFood[*][*]: Integer
      -quantityPheromone[*][*]: Integer
      -airGraphe:Integer
      -longueur: Integer
      -largueur: Integer
      -nbrNoeudDansGraphe:Integer
      -theNoeud: ArrayList<Noeud>

      <<Create>>Graphe(longueur, largueur)
      +CreationEmplacement();
      +getEmplacementNoeud(): Integer
      +rechercherNoeud(x:Integer, y:Integer) : Noeud
      +mettreObstacle(row:Integer, colomn:Integer)
      +mettreNourriture(row:Integer, colomn:Integer, quantity: Integer)
      +getAirGraphe(): Integer
      +getNbrNoeudDansGraphe(): Integer
      +getTaille(): Integer
      +getEstObstacle(): Boolean[*][*]
      +getEstNourriture(): Boolean[*][*]
      +getQuantityFood(): Integer
      +getQuantityPheromone(): Integer
      +getLongueur(): Integer
      +getLargueur(): Integer
      +setQuantityPheromone(quantityPheromone: Integer[*][*])
      +setEstNourriture(estNourriture: Boolean[*][*])
  }

  class Colonie #burlywood {
      -{static} nombreColonie = 0:Integer
      -numColonie:Integer
      -evaporationParam: Integer
      -foodParam: Integer
      -pheromoneParam: Integer
      -quantityFood: Integer

      <<Create>>Colonie()
      +getEvaporationParam(): Integer
      +getFoodParam(): Integer
      +getPheromoneParam(): Integer
      +setEvaporationParam(evaporationParam: Integer)
      +setFoodParam(foodParam: Integer)
      +setPheromoneParam(pheromoneParam: Integer)
      +setQuantityFood(quantityFood: Integer)
      {abstract} +toString(): String
  }

  class Noeud #burlywood {
      -coordonneeNoeud: Integer
      +{static} nombreNoeud: 0: Integer

      <<Create>>Noeud(g:Graphe)
      +getCoordonneNoeud()
      +toString(): String
  }

  class AntFacade #back:Wheat;line.bold {
      -grid: BitSet[*][*]
      -graphe: Graphe
      -theSoldiers: ArrayList<Soldat>
      -theWorkers: ArrayList<Ouvrier>
      -reine: Reine
      -width: Integer
      -height: Integer
      -xColonie: Integer
      -yColonie: Integer
      -sleepingTime: Long
      -antHisto: AntFacadeHistorique

      {abstract}  +setParameters(evaporationParam:Integer,
      {abstract}  foodParam:Integer, pheromoneParam:Integer)
      {abstract}  +createGrid(width:Integer, height:Integer)
      {abstract} +putObstacle(row:Integer, column:Integer)
      {abstract}  +putFood(row:Integer, column:Integer, quantity:Integer)
      {abstract}  +createColony(row:Integer, column:Integer)
      {abstract}  +createSoldiers(amount:Integer)
      {abstract}  +createWorkers(amount:Integer)
      {abstract}  +setAntFile(antLogFile:String)
      {abstract}  +play(duration:Integer, record:Boolean) : BitSet[*][*]
  }

    class AntFacadeHistorique #back:Wheat;line.bold {
        -grid: BitSet[*][*]
        -width: Integer
        -height: Integer
        -durationPlay: Integer
        -fLog: File
        -fw: FileWriter

        <<Create>>AntFacadeHistorique(width:Integer,
          height:Integer, grid:BitSet[*][*], antLogFile:String)
        +startFile()
        +iteration(grid:BitSet[*][*], theWorkers:ArrayList<Ouvrier>,
         theSoldiers:ArrayList<Soldat>)
        +closeFile()
    }

  class Aretes #burlywood {
      -tab[*][*]: Integer
      -estObstacle[*][*]: Boolean
      -x: Integer
      -y: Integer
      -listX: ArrayList<Integer>
      -listY: ArrayList<Integer>
      -graphe: Graphe

      <<Create>>Aretes(g:Graphe, x:Integer, y:Integer)
      +rechercheAretes()
      +ajouterAretes(x:Integer, y:Integer)
      +verficationNoeud(x:Integer, y:Integer):Boolean
      +getListX(): ArrayList<Integer>
      +getListY(): ArrayList<Integer>
  }

  class AretesOuvrier #burlywood {
        -aVisite[*][*]: Boolean

        <<Create>>AretesOuvrier(g:Graphe, x:Integer, y:Integer)
        +paramOuvrier(ouvrier:Ouvrier)
        +rechercheBestPheromone(x:Integer, y:Integer): Boolean
        +rechercheAucunPheromone(droitPassage: Boolean):Boolean
        +rechercheToutVisite(ouvrier:Ouvrier): Boolean
    }

  interface Fourmis <<interface>> #lightgreen;line:green {
      +setX(x:Integer);
      +setY(y:Integer);
  }

  class Reine #lightblue;line:green {
      -x: Integer
      -y: Integer
      -colonie: Colonie
      -graphe: Graphe
      -theSoldiers: ArrayList<Soldat>

      <<Create>>Reine(x:Integer, y:Integer, g:Graphe)
      +giveBirth(amount:Integer)
      +giveBirthWorker(amount:Integer)
      +setParameters(evaporationParam:Integer,
      foodParam:Integer, pheromoneParam:Integer)
      +getTheSoldiers(): ArrayList<Soldat>
      +getTheWorkers(): ArrayList<Ouvrier>
      {abstract} +setX(x:Integer)
      {abstract} +setY(y:Integer)
      +getColonie(): Colonie
  }

  interface FourmisMove <<interface>> #lightgreen;line:green {
      +randomDirection(graphe: Graphe)
      +getX(x:Integer);
      +getY(y:Integer);
  }

  abstract class MoveSoldat #gold;line:goldenrod {
      -x: Integer
      -y: Integer

      <<Create>>MoveSoldat(x:Integer, y:Integer)
      {abstract} +randomDirection(graphe: Graphe, o: Object, r: Reine)
      +getX(x:Integer);
      +getY(y:Integer);
      {abstract} +setX(x:Integer);
      {abstract} +setY(y:Integer);
  }

  abstract class MoveOuvrier #gold;line:goldenrod  {
      -x: Integer
      -y: Integer
      -estObstacle: Boolean[*][*]

      <<Create>>MoveOuvrier(x:Integer, y:Integer)
      {abstract} +randomDirection(graphe: Graphe, o: Object, r: Reine)
      +cheminRetour(ouvrier:Ouvrier)
      +getX(x:Integer);
      +getY(y:Integer);
      {abstract} +setX(x:Integer);
      {abstract} +setY(y:Integer);
  }

  class Soldat #mediumpurple;line:darkviolet {
      -colonie: Colonie
      -graphe: Graphe
      -positionActuel: Noeud
      -{static} nombreSoldat = 0: Integer
      -numeroSoldat: Integer

      <<Create>>Soldat(x:Integer, y:Integer, c:Colonie, g:Graphe)
      +recherchePositionActuel(ligne:Integer, colonne:Integer)
      {abstract} +toString(): String
  }

   class Ouvrier #mediumpurple;line:darkviolet {
        -aVisite[*][*]: Boolean
        -listXRetour: ArrayList<Integer>
        -listYRetour: ArrayList<Integer>
        -etatRetour:Boolean
        -quantityFoodTaken: Integer
        -colonie: Colonie
        -graphe: Graphe
        -positionActuel: Noeud
        -{static} nombreOuvrier = 0: Integer
        -numeroOuvrier: Integer
        -xColinie: Integer
        -yColonie: Integer

        <<Create>>Ouvrier(x:Integer, y:Integer, c:Colonie, g:Graphe)
        +recherchePositionActuel(ligne:Integer, colonne:Integer)
        +doitRetravailler(): Boolean

        {abstract} +toString(): String
        +getaVisite(): Boolean[*][*]
        +setaVisite(aVisite: Boolean[*][*])
        -getListXRetour(): ArrayList<Integer>
        -getListYRetour(): ArrayList<Integer>
        +isEtatRetour(): Boolean
        +isEtatRetour(): Noeud
        +setEtatRetour(etatRetour: Boolean)
        +setQuantityFoodTaken(quantityFoodTaken: Boolean)
    }
}


AntFacadeController <|.. AntFacade : <<implements>>
AntFacade .up.|> Graphe : <<instantiate>>
AntFacade ..|> Reine : <<instantiate>>

Graphe "1" *--> "1..*" Noeud : contient

Reine "1" *-> "1" Colonie : appartient
Noeud "1" *--> "0..*\t" Fourmis : comporte

Fourmis <|.. Reine : <<implements>>
Fourmis <|.. FourmisMove : <<extends>>

Aretes <|-- AretesOuvrier : <<extends>>
Aretes <.. MoveSoldat : <<use>>
AretesOuvrier <.. MoveOuvrier : <<use>>

FourmisMove <|.. MoveOuvrier : \n\n<<implements>>
FourmisMove <|.. MoveSoldat : <<implements>>

MoveSoldat <|-- Soldat : <<extends>>
MoveOuvrier <|-- Ouvrier : <<extends>>
Reine "1" o--> "1..*" Soldat : donne naissance
Reine "1" o--> "1..*" Ouvrier : donne naissance

AntFacade ..> Soldat : <<use>>
AntFacade ..> Ouvrier : <<use>>
Aretes .up.> Graphe : <<use>>
AretesOuvrier .up.> Graphe : <<use>>
AretesOuvrier ..> Ouvrier : <<use>>
MoveSoldat ..> Reine : <<use>>
MoveOuvrier ..> Reine : <<use>>
Ouvrier ..> Colonie : <<use>>
Soldat ..> Colonie : <<use>>
AntFacade o--> AntFacadeHistorique : sauvegarde
AntFacadeHistorique .right.> Soldat : <<use>>
AntFacadeHistorique .right.> Ouvrier : <<use>>
@enduml