コード例 #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);
 }
コード例 #2
0
ファイル: BTVariantTest.cs プロジェクト: longde123/EntitiesBT
 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);
 }
コード例 #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());
        }
コード例 #4
0
 protected override void Build(ref PrioritySelectorNode data, BlobBuilder blobBuilder, ITreeNode <INodeDataBuilder>[] builders)
 {
     blobBuilder.AllocateArray(ref data.Weights, Weights);
 }
コード例 #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());
        }
コード例 #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);
 }
コード例 #7
0
 protected override void Build(ref WeightRandomSelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] __)
 {
     data.Sum = _weights.Sum();
     builder.AllocateArray(ref data.Weights, _weights);
 }
コード例 #8
0
 protected override void Build(ref EntitiesBT.Nodes.PrioritySelectorNode data, BlobBuilder builder, ITreeNode <INodeDataBuilder>[] tree)
 {
     builder.AllocateArray(ref data.Weights, Weights);
 }