diff --git a/examples/controlplane/2a_cnc_interactive.jl b/examples/controlplane/2a_cnc_interactive.jl index 43595067..19f14c35 100644 --- a/examples/controlplane/2a_cnc_interactive.jl +++ b/examples/controlplane/2a_cnc_interactive.jl @@ -1,6 +1,6 @@ include("setup.jl") -controller = Controller(sim, net, 6, zeros(8,8)) +controller = Controller(sim, net, 6, fill(nothing, 8, 8)) @process controller() req_gen = RequestGenerator(sim, net, 1, 8, 6) diff --git a/src/ProtocolZoo/ProtocolZoo.jl b/src/ProtocolZoo/ProtocolZoo.jl index 5d35d1b3..a450b040 100644 --- a/src/ProtocolZoo/ProtocolZoo.jl +++ b/src/ProtocolZoo/ProtocolZoo.jl @@ -428,7 +428,7 @@ end error("`EntanglementTracker` on node $(prot.node) received a message $(msg) that it does not know how to handle (due to the absence of corresponding `EntanglementCounterpart` or `EntanglementHistory` or `EntanglementDelete` tags). This might have happened due to `CutoffProt` deleting qubits while swaps are happening. Make sure that the retention times in `CutoffProt` are sufficiently larger than the `agelimit` in `SwapperProt`. Otherwise, this is a bug in the protocol and should not happen -- please report an issue at QuantumSavory's repository.") end end - # @debug "EntanglementTracker @$(prot.node): Starting message wait at $(now(prot.sim)) with MessageBuffer containing: $(mb.buffer)" + @debug "EntanglementTracker @$(prot.node): Starting message wait at $(now(prot.sim)) with MessageBuffer containing: $(mb.buffer)" @yield wait(mb) @debug "EntanglementTracker @$(prot.node): Message wait ends at $(now(prot.sim))" end @@ -547,7 +547,7 @@ end end end end - # @debug "RequestTracker @$(prot.node): Starting message wait at $(now(prot.sim)) with MessageBuffer containing: $(mb.buffer)" + @debug "RequestTracker @$(prot.node): Starting message wait at $(now(prot.sim)) with MessageBuffer containing: $(mb.buffer)" @yield wait(mb) @debug "RequestTracker @$(prot.node): Message wait ends at $(now(prot.sim))" end diff --git a/src/ProtocolZoo/controllers.jl b/src/ProtocolZoo/controllers.jl index 2f0d9e2c..cf73f7a2 100644 --- a/src/ProtocolZoo/controllers.jl +++ b/src/ProtocolZoo/controllers.jl @@ -72,7 +72,7 @@ See also [`RequestGenerator`](@ref), [`RequestTracker`](@ref) """The node in the network where the control protocol is physically located, ideally a centrally located node""" node::Int """A matrix for the object containing physical graph metadata for the network""" - path_mat::Matrix{Union{Float64, PathMetadata}} + path_mat::Matrix{Union{Nothing, PathMetadata}} end @resumable function (prot::Controller)() @@ -84,7 +84,7 @@ end msg = querydelete!(mb, DistributionRequest, ❓, ❓) if !isnothing(msg) (msg_src, (_, src, dst)) = msg - if typeof(prot.path_mat[src, dst]) <: Number + if isnothing(prot.path_mat[src, dst]) prot.path_mat[src, dst] = PathMetadata(prot.net.graph, src, dst, Int(length(prot.net[1].staterefs)/2)) end path_id = path_selection(prot.sim, prot.path_mat[src, dst]) @@ -113,7 +113,7 @@ end end end end - # @debug "Controller @$(prot.node): Starting message wait at $(now(prot.sim)) with MessageBuffer containing: $(mb.buffer)" + @debug "Controller @$(prot.node): Starting message wait at $(now(prot.sim)) with MessageBuffer containing: $(mb.buffer)" @yield wait(mb) @debug "Controller @$(prot.node): Message wait ends at $(now(prot.sim))" end