Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
 protected override void Build(ref PrioritySelectorNode data, BlobBuilder blobBuilder, ITreeNode <INodeDataBuilder>[] builders)
 {
     blobBuilder.AllocateArray(ref data.Weights, Weights);
 }
Ejemplo n.º 5
0
        public override void Build(BlobBuilder builder, ref BlobArray <float> data)
        {
            float sum = Weights.Sum();

            builder.AllocateArray(ref data, Weights.Select(w => w / sum).ToArray());
        }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 8
0
 protected override void Build(ref EntitiesBT.Nodes.PrioritySelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] tree)
 {
     builder.AllocateArray(ref data.Weights, Weights);
 }