@startuml
:Utilisateur: as usr
database "Base de\ndonnée" as db
file "UDP" <<lib>> as udp
file "TensorFlow" <<lib>> as tf
file "Keras" <<lib>> as keras

package "Client CoAP" as global {
    component "Superviseur" as super <<Thread>>{
        () "Interface CoAP" as h_coap
        () "Collecteur donnée" as h_stat

        component "Gestionaire\nglobal" <<main>> as main_super
        component "Statisticien" as stat

        stack "buffer\nd'experience" as buff
        [NN]
        [optimiseur]
        [horloge] <<interuption>>

        h_coap -- main_super

        buff --> optimiseur : expérience
        optimiseur --> NN : met à jour
        horloge --> optimiseur : déclanche

        h_stat - stat
        stat -> buff : remplis
    }
    component "Session" as client <<Threads>> {
        () "Socket UDP" as s_udp
        () "Session handle" as h_session_message
        () "RTO" as h_session_rto
        queue "Buffer" as file_attente
        [Gestionaire\nde la session] <<main>> as main_sess
        [timer] <<interuption>> as timer
        h_session_message -- main_sess
        h_session_rto -- main_sess
        main_sess --> s_udp : packet\nudp
        main_sess ..> file_attente : use
        main_sess <-- s_udp : aquitement\n&\nréponse
        main_sess ..> timer : use
    }

    main_super --( h_session_message
    NN --( h_session_rto
    main_sess --( h_stat

    note top of client
        Un par capteur
    end note
}

usr --( h_coap
db --( h_coap


buff ..> tf : use
optimiseur ..> tf : use
NN ..> keras : use
s_udp ..> udp : use


@enduml
