diff --git a/src/runtime2/communication.rs b/src/runtime2/communication.rs index 7f84183fdc9885c463fad673a24142500abeceb7..f879550f7307f7dc5a0b96d908adab1299f2175e 100644 --- a/src/runtime2/communication.rs +++ b/src/runtime2/communication.rs @@ -79,30 +79,37 @@ pub struct SyncMessage { } #[derive(Debug)] -pub struct SyncLocalSolutionEntry { - pub self_port_id: PortId, - pub peer_comp_id: CompId, - pub peer_port_id: PortId, - pub mapping: u32, - pub port_kind: PortKind, +pub enum SyncLocalSolutionEntry { + Putter(SyncSolutionPutterPort), + Getter(SyncSolutionGetterPort), } pub type SyncLocalSolution = Vec; +/// Getter port in a solution. Upon receiving a message it is certain about who +/// its peer is. #[derive(Debug)] -pub struct SyncSolutionPort { +pub struct SyncSolutionGetterPort { pub self_comp_id: CompId, pub self_port_id: PortId, pub peer_comp_id: CompId, pub peer_port_id: PortId, pub mapping: u32, - pub port_kind: PortKind, +} + +/// Putter port in a solution. A putter may not be certain about who its peer +/// component/port is. +#[derive(Debug)] +pub struct SyncSolutionPutterPort { + pub self_comp_id: CompId, + pub self_port_id: PortId, + pub mapping: u32, } #[derive(Debug)] pub struct SyncSolutionChannel { - pub putter: Option, - pub getter: Option, + pub putter: Option, + pub getter: Option, } #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -114,16 +121,16 @@ pub enum SyncRoundDecision { #[derive(Debug)] pub struct SyncPartialSolution { - pub submissions_by: Vec<(CompId, bool)>, pub channel_mapping: Vec, + pub matched_channels: usize, pub decision: SyncRoundDecision, } impl Default for SyncPartialSolution { fn default() -> Self { return Self{ - submissions_by: Vec::new(), channel_mapping: Vec::new(), + matched_channels: 0, decision: SyncRoundDecision::None, } }