public override void Explore(IInformationState state, string description)
        {
            State = ((IQuantumState)state);
            this.Text = description;

            Start();
        }
        public virtual bool TransmitSynchronous(IInformationState state)
        {
            DoOnTransmit(this, state);

            if (_channel != null)
            {return _channel.Transmit(this, state);}
            else
            {return false;}
        }
        public bool Transmit(TransmissionMethod method, IInformationState state)
        {
            if (method.Equals(TransmissionMethod.Synchronous))
            { return TransmitSynchronous(state); };

            if (method.Equals(TransmissionMethod.Asynchronous))
            { return TransmitAsynchronous(state); };

            return false;
        }
Пример #4
0
 // TRANSMIT
 public bool Transmit(IChannelTransmissor transmissor, IInformationState state)
 {
     if (_transmissors.Contains(transmissor))
     {
         performDelay(state);
         performNoise(state);
         return Difussion(state);
     }
     else
     {
         throw new ChannelException();
     }
 }
 // DELAY
 protected override void performDelay(IInformationState state)
 {
     if (EffectiveDelayTicks != 0)
     {
         if (state is IClassicalState)
         {
             IClassicalDelayOperator delayer = FactoryClassicalOperator.generateDelayOperator();
             delayer.UseGlobalConfiguration = false;
             delayer.Configuration.DelayEnabled = true;
             delayer.Configuration.DelayTicks = EffectiveDelayTicks;
             delayer.Evaluate((IClassicalState)state);
         }
         else
         { throw new ExceptionClassicalChannel(); }
     }
 }
 // NOISE
 protected override void performNoise(IInformationState state)
 {
     if (EffectiveNoiseFactor != 0)
     {
         if (state is IClassicalState)
         {
             IClassicalNoiseOperator noiser = FactoryClassicalOperator.generateNoiseOperator();
             noiser.UseGlobalConfiguration = false;
             noiser.Configuration.NoiseEnabled = true;
             noiser.Configuration.NoiseFactor = EffectiveNoiseFactor;
             noiser.Evaluate((IClassicalState)state);
         }
         else
         { throw new ExceptionClassicalChannel(); }
     }
 }
        protected void PropagateOnReceive(IChannelReceiver receiver, IInformationState state)
        {
            if (OnReceive != null)
            { OnReceive(this, state); };

            if (state is IClassicState)
            {
                if (OnClassicReceive != null)
                { OnClassicReceive(this, (IClassicState)state); };
            }
        }
Пример #8
0
 protected void EvaluateOnTransmit(ISniffer sniffer, IInformationState state)
 {
     textBoxTransmit.AppendText("Transmission Detected:");
     textBoxTransmit.AppendText("\r\n");
     textBoxTransmit.AppendText(state.generateDebugger().FullDebug);
     textBoxTransmit.AppendText("\r\n");
     textBoxTransmit.AppendText("\r\n");
 }
 private void DoOnTransmit(ITransmissor receiver, IInformationState state)
 {
     if (OnTransmit != null)
     { OnTransmit(this, state); };
 }
 public abstract bool TransmitSynchronous(IInformationState state);
 protected void PropagateOnReceive(IChannelStation station, IInformationState state)
 {
     if (OnReceive != null)
     { OnReceive(this, state); };
 }
        protected override void performNoise(IInformationState state)
        {
            if (NoiseConfiguration.NoiseEnabled == false) { return; }

            if (NoiseConfiguration.NoiseFactor != 0)
            {
                if (state is IQuantumState)
                {
                    IQuantumOperatorNoise noiser = QuantumOperatorFactory.generateNoiseOperator();
                    noiser.Configuration.UseDefaultConfiguration = false;
                    ((IQuantumOperatorNoiseConfiguration)(noiser.Configuration)).NoiseEnabled = true;
                    ((IQuantumOperatorNoiseConfiguration)(noiser.Configuration)).NoiseFactor = NoiseConfiguration.NoiseFactor;
                    noiser.Evaluate((IQuantumState)state);
                }
                else
                { throw new QuantumChannelException(); }
            }
        }
        protected void PropagateOnTransmit(IChannelStation station, IInformationState state)
        {
            if (OnTransmit != null)
            { OnTransmit(this, state); };

            if (state is IClassicState)
            {
                if (OnClassicTransmit != null)
                { OnClassicTransmit(this, (IClassicState)state); };
            }

            if (state is IQuantumState)
            {
                if (OnQuantumTransmit != null)
                { OnQuantumTransmit(this, (IQuantumState)state); };
            }
        }
        protected void PropagateOnReceive(IChannelStation station, IInformationState state)
        {
            if (OnReceive != null)
            { OnReceive(this, state); };

            if (state is IClassicState)
            {
                if (OnClassicReceive != null)
                { OnClassicReceive(this, (IClassicState)state); };
            }

            if (state is IQuantumState)
            {
                if (OnQuantumReceive != null)
                { OnQuantumReceive(this, (IQuantumState)state); };
            }
        }
 public override bool TransmitSynchronous(IInformationState state)
 {
     bool step1 = ClassicTransmitSynchronous(state);
     bool step2 = QuantumTransmitSynchronous(state);
     return (step1 && step2);
 }
 public override bool Receive(IInformationState state)
 {
     bool step1 = ClassicReceive(state);
     bool step2 = QuantumReceive(state);
     return (step1 && step2);
 }
 public bool QuantumTransmitSynchronous(IInformationState state)
 {
     return _quantumStation.TransmitSynchronous(state);
 }
 public bool QuantumReceive(IInformationState state)
 {
     return _quantumStation.Receive(state);
 }
        protected void PropagateOnReceive(IChannelReceiver receiver, IInformationState state)
        {
            if (OnReceive != null)
            { OnReceive(this, state); };

            if (state is IQuantumState)
            {
                if (OnQuantumReceive != null)
                { OnQuantumReceive(this, (IQuantumState)state); };
            }
        }
 public bool ClassicReceive(IInformationState state)
 {
     return _ClassicStation.Receive(state);
 }
 public virtual void Explore(IInformationState state, string description)
 {
     //			textBox.Text = state.generateQuantumDebugger().FullDebug;
     //			Text += ": " + description;
     //			Show();
 }
 public bool ClassicTransmitSynchronous(IInformationState state)
 {
     return _ClassicStation.TransmitSynchronous(state);
 }
        protected override void performDelay(IInformationState state)
        {
            if (DelayConfiguration.DelayEnabled == false) { return; }

            if (DelayConfiguration.DelayTicks != 0)
            {
                if (state is IQuantumState)
                {
                    IQuantumOperatorDelay delayer = QuantumOperatorFactory.generateDelayOperator();
                    delayer.Configuration.UseDefaultConfiguration = false;
                    ((IQuantumOperatorDelayConfiguration)(delayer.Configuration)).DelayEnabled = true;
                    ((IQuantumOperatorDelayConfiguration)(delayer.Configuration)).DelayTicks = DelayConfiguration.DelayTicks;
                    delayer.Evaluate((IQuantumState)state);
                }
                else
                { throw new QuantumChannelException(); }
            }
        }
Пример #24
0
        protected void PropagateOnTransmit(ITransmissor transmissor, IInformationState state)
        {
            if (OnTransmit != null)
            { OnTransmit(this, state); };

            if (state is IQuantumState)
            {
                if (OnQuantumTransmit != null)
                { OnQuantumTransmit(this, (IQuantumState)state); };
            }
        }
 protected void PropagateOnTransmit(IChannelStation station, IInformationState state)
 {
     if (OnTransmit != null)
     { OnTransmit(this, state); };
 }
 public override bool Receive(IInformationState state)
 {
     return _receiver.Receive(state);
 }
 public abstract bool Receive(IInformationState state);
 public override bool TransmitSynchronous(IInformationState state)
 {
     return _transmissor.TransmitSynchronous(state);
 }
        protected void PropagateOnTransmit(IChannelTransmissor transmissor, IInformationState state)
        {
            if (OnTransmit != null)
            { OnTransmit(this, state); };

            if (state is IClassicState)
            {
                if (OnClassicTransmit != null)
                { OnClassicTransmit(this, (IClassicState)state); };
            }
        }
Пример #30
0
 protected void EvaluateOnReceive(ISniffer sniffer, IInformationState state)
 {
     textBoxReceive.AppendText("Reception Detected:");
     textBoxReceive.AppendText("\r\n");
     textBoxReceive.AppendText(state.generateDebugger().FullDebug);
     textBoxReceive.AppendText("\r\n");
     textBoxReceive.AppendText("\r\n");
 }