protected override void Build(ref VariablesTestNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] builders) { LongVariable.Allocate(ref builder, ref data.LongVariable); builder.AllocateString(ref data.String, String); builder.AllocateArray(ref data.IntArray, IntArray); DestVariable.Allocate(ref builder, ref data.DestVariable); SrcVariable.Allocate(ref builder, ref data.SrcVariable); }
protected override unsafe void Build(ref VariablesTestNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] tree) { LongReader.Allocate(ref builder, ref data.LongReader, this, tree); builder.AllocateString(ref data.String, String); builder.AllocateArray(ref data.IntArray, IntArray); LongWriter.Allocate(ref builder, ref data.LongWriter, this, tree); SingleReader.Allocate(ref builder, ref data.SingleReader, this, tree); data.Long = LongValue; SingleReaderAndWriter.Allocate(ref builder, ref data.SingleReaderAndWriter, this, tree); }
protected override void Build(ref WeightRandomSelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] __) { var sum = _weights.Sum(); builder.AllocateArray(ref data.NormalizedWeights, _weights.Select(w => w / sum).ToArray()); }
protected override void Build(ref PrioritySelectorNode data, BlobBuilder blobBuilder, ITreeNode <INodeDataBuilder>[] builders) { blobBuilder.AllocateArray(ref data.Weights, Weights); }
public override void Build(BlobBuilder builder, ref BlobArray <float> data) { float sum = Weights.Sum(); builder.AllocateArray(ref data, Weights.Select(w => w / sum).ToArray()); }
protected override void Build(ref EntitiesBT.Nodes.WeightRandomSelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] tree) { data.Sum = Sum; builder.AllocateArray(ref data.Weights, Weights); }
protected override void Build(ref WeightRandomSelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] __) { data.Sum = _weights.Sum(); builder.AllocateArray(ref data.Weights, _weights); }
protected override void Build(ref EntitiesBT.Nodes.PrioritySelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] tree) { builder.AllocateArray(ref data.Weights, Weights); }