public void Update() { OnUpdate(); // Propagate update to all ports Inputs.ForEach(port => port.OnUpdate()); Outputs.ForEach(port => port.OnUpdate()); }
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); }
public void Dirty() { OnDirty(); // Dirty all ports so they can refresh their state Inputs.ForEach(port => port.OnDirty()); Outputs.ForEach(port => port.OnDirty()); }
private void CalculateErrors() { Outputs.ForEach(p => { p.Error = p.Value - p.Expected; }); CalculateHiddenErrors(); }
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(); }
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; } } }
public void PostLoad(Context context, Profile parentProfile) { SetProfile(parentProfile); ZipDeviceBindingList(Outputs); Outputs.ForEach(o => o.DeviceIoType = DeviceIoType.Output); }
public void SetProfile(Profile profile) { Profile = profile; Outputs.ForEach(o => o.Profile = profile); }
public void PushValueOnOuput(double outputValue) { //Update values of output synapses Outputs.ForEach(output => output.Output = outputValue); }
public void Activate(double value, Neuron from) { InputValues[from] = value; Outputs.ForEach(o => o.Destination.Activate(ActivatedValue * o.Weight, this)); }
public void PushValueOnOutput(double outputValue) { Outputs.ForEach(output => output.Output = outputValue); //synapsy wyjsciowe }
public void PushValueOnOutput(double outputValue) { //Nowe wartosci dla synaps wyjściowych Outputs.ForEach(output => output.Output = outputValue); }