Exemple #1
0
        public override void Evaluate <T>(
            ICircuitEvaluator <T> evaluator,
            EvaluationState <T> evaluationState)
        {
            T value = evaluator.EvaluateAndGate(
                evaluationState.GetGateEvaluationValue(_leftInputGate),
                evaluationState.GetGateEvaluationValue(_rightInputGate)
                );

            evaluationState.SetGateEvaluationValue(this, value);
        }
Exemple #2
0
        public T[] EvaluateAndGateBatch(GateEvaluationInput <T>[] evaluationInputs)
        {
            T[] outputValues = new T[evaluationInputs.Length];
            for (int i = 0; i < evaluationInputs.Length; ++i)
            {
                GateEvaluationInput <T> evaluationInput = evaluationInputs[i];
                outputValues[i] = _innerEvaluator.EvaluateAndGate(
                    evaluationInput.LeftValue,
                    evaluationInput.RightValue
                    );
            }

            return(outputValues);
        }
Exemple #3
0
 public Task <T> EvaluateAndGate(Task <T> leftValue, Task <T> rightValue, GateContext gateContext, CircuitContext circuitContext)
 {
     return(Task.WhenAll(leftValue, rightValue).ContinueWith(
                task => _innerEvaluator.EvaluateAndGate(task.Result[0], task.Result[1], gateContext, circuitContext)
                ));
 }