Ejemplo n.º 1
0
        public void Update()
        {
            OnUpdate();

            // Propagate update to all ports
            Inputs.ForEach(port => port.OnUpdate());
            Outputs.ForEach(port => port.OnUpdate());
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     Inputs.ForEach(i => i.Dispose());
     Outputs.ForEach(o => o.Dispose());
     InternalOps.ForEach(o => o.Dispose());
     InternalParts.ForEach(p => p.Dispose());
     Definition.RemoveInstance(this);
 }
Ejemplo n.º 3
0
        public void Dirty()
        {
            OnDirty();

            // Dirty all ports so they can refresh their state
            Inputs.ForEach(port => port.OnDirty());
            Outputs.ForEach(port => port.OnDirty());
        }
Ejemplo n.º 4
0
        private void CalculateErrors()
        {
            Outputs.ForEach(p =>
            {
                p.Error = p.Value - p.Expected;
            });

            CalculateHiddenErrors();
        }
Ejemplo n.º 5
0
        public override void Removed()
        {
            base.Removed();

            IdChanged          = null;
            NameChanged        = null;
            InputsChanged      = null;
            OutputsChanged     = null;
            StateChanged       = null;
            StateStringChanged = null;

            Inputs.ForEach(i => i.RemovedFromRouter(this));
            inputs.Clear();

            Outputs.ForEach(o => o.RemovedFromRouter(this));
            outputs.Clear();
        }
Ejemplo n.º 6
0
            public override void ReadWrite(BitcoinStream stream)
            {
                using (var memory = new MemoryStream())
                {
                    var tx = new BitcoinStream(memory, stream.Serializing)
                    {
                        Type               = stream.Type,
                        ProtocolVersion    = stream.ProtocolVersion,
                        TransactionOptions = stream.TransactionOptions,
                    };

                    if (!stream.Serializing)
                    {
                        var header = stream.Inner.ReadBytes(8);
                        memory.Write(header, 0, 4);
                        stream.Inner.CopyTo(memory);

                        memory.Position = 0;
                        base.ReadWrite(tx);
                        nTime = BitConverter.ToUInt32(header, 4);
                        Outputs.ForEach(o => o.Value *= 100); // NOTICE: Change Unit (XP to BTC)
                    }
                    else
                    {
                        var tmp = new Transaction()
                        {
                            Version = Version, LockTime = LockTime
                        };
                        tmp.Inputs.AddRange(Inputs);
                        tmp.Outputs.AddRange(Outputs.Select(o => new TxOut(o.Value / 100, o.ScriptPubKey))); // NOTICE: Change Unit (BTC to XP)
                        tmp.ReadWrite(tx);

                        var binary = memory.ToArray();
                        stream.ReadWrite(ref binary, 0, 4);                 // int nVersion
                        stream.ReadWrite(ref nTime);                        // uint32_t nTime
                        stream.ReadWrite(ref binary, 4, binary.Length - 4); // std::vector<CTxIn> vin; std::vector<CTxOut> vout; uint32_t nLockTime;
                    }
                }
            }
Ejemplo n.º 7
0
 public void PostLoad(Context context, Profile parentProfile)
 {
     SetProfile(parentProfile);
     ZipDeviceBindingList(Outputs);
     Outputs.ForEach(o => o.DeviceIoType = DeviceIoType.Output);
 }
Ejemplo n.º 8
0
 public void SetProfile(Profile profile)
 {
     Profile = profile;
     Outputs.ForEach(o => o.Profile = profile);
 }
Ejemplo n.º 9
0
 public void PushValueOnOuput(double outputValue)
 {
     //Update values of output synapses
     Outputs.ForEach(output => output.Output = outputValue);
 }
Ejemplo n.º 10
0
Archivo: Neuron.cs Proyecto: ndesmic/Nn
 public void Activate(double value, Neuron from)
 {
     InputValues[from] = value;
     Outputs.ForEach(o => o.Destination.Activate(ActivatedValue * o.Weight, this));
 }
Ejemplo n.º 11
0
 public void PushValueOnOutput(double outputValue)
 {
     Outputs.ForEach(output => output.Output = outputValue); //synapsy wyjsciowe
 }
Ejemplo n.º 12
0
 public void PushValueOnOutput(double outputValue)
 {
     //Nowe wartosci dla synaps wyjściowych
     Outputs.ForEach(output => output.Output = outputValue);
 }