17#include "ns3/channel.h"
18#include "ns3/nstime.h"
20#include "ns3/random-variable-stream.h"
21#include "ns3/type-id.h"
124 void SetQMap(ns3::Ptr<QMap> m);
137 ns3::Ptr<QMap>
GetQMap()
const;
240 void Connect(ns3::Ptr<QNetDevice> a, ns3::Ptr<QNetDevice> b);
254 ns3::Ptr<ns3::NetDevice>
GetDevice(std::size_t i)
const override;
298 ns3::Ptr<ns3::UniformRandomVariable>
mapRv_;
Duplex quantum channel with configurable delay, jitter, and transit maps.
ns3::Ptr< ns3::NetDevice > GetDevice(std::size_t i) const override
Return an attached device by endpoint index.
void SetJitter(ns3::Time j)
Set the same jitter in both directions.
void SetJitterBA(ns3::Time j)
Set the one-way jitter from B to A.
std::size_t GetNDevices() const override
Return the number of attached devices.
ns3::Time delayAB_
Propagation delay from A to B.
ns3::Time delayBA_
Propagation delay from B to A.
ns3::Ptr< QMap > GetQMap() const
Get the A->B transit QMap.
bool SendFrom(QNetDevice *src, std::shared_ptr< Qubit > q)
Send a qubit from one endpoint to the opposite endpoint.
void SetDelay(ns3::Time d)
Set the same propagation delay in both directions.
~QChannel() override=default
Protected destructor to prevent stack allocation.
void SetQMap(ns3::Ptr< QMap > m)
Set the same transit QMap in both directions.
ns3::Ptr< ns3::UniformRandomVariable > jitterRv_
Jitter sampler.
void SetDelayAB(ns3::Time d)
Set the one-way delay from A to B.
void SetJitterAB(ns3::Time j)
Set the one-way jitter from A to B.
ns3::Ptr< QMap > qmapAB_
Transit QMap from A to B. Null means identity.
ns3::Ptr< QNetDevice > aDev_
Device attached to endpoint A.
ns3::Ptr< QNetDevice > bDev_
Device attached to endpoint B.
void SetQMapAB(ns3::Ptr< QMap > m)
Set the one-way transit QMap from A to B.
int64_t AssignStreams(int64_t stream)
Assign RNG streams used by this channel.
void SetQMapBA(ns3::Ptr< QMap > m)
Set the one-way transit QMap from B to A.
ns3::Time GetJitterAB() const
Get the one-way jitter from A to B.
void SetDelayBA(ns3::Time d)
Set the one-way delay from B to A.
ns3::Ptr< QMap > GetQMapBA() const
Get the one-way transit QMap from B to A.
static ns3::TypeId GetTypeId(void)
Get the ns-3 TypeId.
ns3::Time GetDelay() const
Get the A->B propagation delay.
void Connect(ns3::Ptr< QNetDevice > a, ns3::Ptr< QNetDevice > b)
Connect two QNetDevice endpoints to this channel.
ns3::Time GetDelayAB() const
Get the one-way delay from A to B.
ns3::Time jitterBA_
Jitter magnitude from B to A.
ns3::Ptr< QMap > qmapBA_
Transit QMap from B to A. Null means identity.
ns3::Time GetJitter() const
Get the A->B jitter.
ns3::Time jitterAB_
Jitter magnitude from A to B.
ns3::Time GetJitterBA() const
Get the one-way jitter from B to A.
ns3::Time GetDelayBA() const
Get the one-way delay from B to A.
ns3::Ptr< ns3::UniformRandomVariable > mapRv_
QMap sampler.
QChannel()
Default constructor.
ns3::Ptr< QMap > GetQMapAB() const
Get the one-way transit QMap from A to B.
Minimal quantum net device that bridges a QChannel and a QNetworker.