Source code for ddf.message
from abc import ABC
from dataclasses import dataclass
from enum import Enum
from uuid import UUID
import numpy as np
from .ant_link.loss_channel import LossChannel
from .ddf import NodeId, ObjectId
from .information import ExchangeVector
[docs]
@dataclass
class InfoMessage(Message):
object_id: ObjectId
state: ExchangeVector
message_counter: int
[docs]
@dataclass
class GradientMessage(Message):
object_id: ObjectId
gradient: np.ndarray
loss_channel: LossChannel
[docs]
@dataclass
class NodeInfoMessage(Message):
available: list[str]
exchange: list[str]
alias: str
req_id: UUID
[docs]
@dataclass
class NodeContextMessage(Message):
# context from manufacturer for example: about the machine
fixed_context: str
# context set by the user
user_context: str
req_id: UUID
[docs]
@dataclass
class ProbeResponseMessage(Message):
reference: ObjectId
gradient: np.ndarray
loss_channel: LossChannel