示例#1
0
        public void Update()
        {
            OnUpdate();

            // Propagate update to all ports
            Inputs.ForEach(port => port.OnUpdate());
            Outputs.ForEach(port => port.OnUpdate());
        }
示例#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);
 }
示例#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());
        }
示例#4
0
        private void CalculateErrors()
        {
            Outputs.ForEach(p =>
            {
                p.Error = p.Value - p.Expected;
            });

            CalculateHiddenErrors();
        }
示例#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();
        }
示例#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;
                    }
                }
            }
示例#7
0
 public void PostLoad(Context context, Profile parentProfile)
 {
     SetProfile(parentProfile);
     ZipDeviceBindingList(Outputs);
     Outputs.ForEach(o => o.DeviceIoType = DeviceIoType.Output);
 }
示例#8
0
 public void SetProfile(Profile profile)
 {
     Profile = profile;
     Outputs.ForEach(o => o.Profile = profile);
 }
示例#9
0
 public void PushValueOnOuput(double outputValue)
 {
     //Update values of output synapses
     Outputs.ForEach(output => output.Output = outputValue);
 }
示例#10
0
文件: Neuron.cs 项目: ndesmic/Nn
 public void Activate(double value, Neuron from)
 {
     InputValues[from] = value;
     Outputs.ForEach(o => o.Destination.Activate(ActivatedValue * o.Weight, this));
 }
示例#11
0
 public void PushValueOnOutput(double outputValue)
 {
     Outputs.ForEach(output => output.Output = outputValue); //synapsy wyjsciowe
 }
示例#12
0
文件: Neuron.cs 项目: Piwo13/Kolos
 public void PushValueOnOutput(double outputValue)
 {
     //Nowe wartosci dla synaps wyjściowych
     Outputs.ForEach(output => output.Output = outputValue);
 }