本文整理汇总了C#中IModel.GenerateControlVariables方法的典型用法代码示例。如果您正苦于以下问题:C# IModel.GenerateControlVariables方法的具体用法?C# IModel.GenerateControlVariables怎么用?C# IModel.GenerateControlVariables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IModel
的用法示例。
在下文中一共展示了IModel.GenerateControlVariables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Advisor
public Advisor(IModel model, List<Property> properties, List<LoggedValue> loggedValues)
{
_model = model;
MODEL_ACTION_VAR_COUNT = _model.GenerateControlVariables().Count;
MODEL_STATE_VAR_COUNT = _model.GetInitialState().Count;
HORIZON_SIZE = (int)Convert.ToDouble(properties.Find(p => p.Name.Equals("Horizon")).Value);
Vsize = (int)Convert.ToDouble(properties.Find(p => p.Name.Equals("Neurons Number")).Value);
BetaV = Convert.ToDouble(properties.Find(p => p.Name.Equals("BetaV")).Value);
Gamma = Convert.ToDouble(properties.Find(p => p.Name.Equals("Discount")).Value);;
Sigma = Convert.ToDouble(properties.Find(p => p.Name.Equals("Sigma")).Value);
SigmaMin = Convert.ToDouble(properties.Find(p => p.Name.Equals("SigmaMin")).Value);
TimesToAdjust = (int)Convert.ToDouble(properties.Find(p => p.Name.Equals("TimesToAdjust")).Value);
var externalDiscretization =
Convert.ToDouble(properties.Find(p => p.Name.Equals("ExternalDiscretization")).Value);
var internalDiscretization =
Convert.ToDouble(properties.Find(p => p.Name.Equals("InternalDiscretization")).Value);
var TimeLimit = Convert.ToDouble(properties.Find(p => p.Name.Equals("TimeLimit")).Value);
TimesToTeach = (int)Convert.ToDouble(properties.Find(p => p.Name.Equals("TimesToTeach")).Value);
TimesToAdjustPastActions = (int)Convert.ToDouble(properties.Find(p => p.Name.Equals("TimesToAdjustPastActions")).Value);
_logger = new LogIt("", loggedValues);
_model.SetDiscretizations(externalDiscretization, internalDiscretization);
TimeIndex = 0;
_episodeNr = 0;
AllVisits = new ArrayList();
Sampler = new ASampler();
IterationsLimit = (int) (TimeLimit / externalDiscretization);
VestSum = 0;
StartInState(_model.GetInitialState().ToArray());
MinAction = new Vector(_model.MinActionValues());
MaxAction = new Vector(_model.MaxActionValues());
double[] stateAverage = _model.GetStateValuesAverageNN().ToArray();
double[] stateStandardDeviation = _model.GetStateValuesStandardDeviationNN().ToArray();
Init(stateAverage, stateStandardDeviation, MinAction.Table, Vsize);
}