public void model_revert(CtwContextTreeUndo undoInstance)
{
while (this.history_size()>undoInstance.HistorySize){
if (this.LastUpdate == PerceptUpdate)
{
this.ContextTree.revert_tree(this.Environment.perceptBits());
this.LastUpdate = ActionUpdate;
}
else {
this.ContextTree.revert_tree_history(this.Environment.actionBits());
//this.context_tree.revert_tree_history(this.environment.actionBits());
this.LastUpdate = PerceptUpdate;
}
}
this.Age = undoInstance.Age;
this.TotalReward = undoInstance.TotalReward;
this.LastUpdate = undoInstance.LastUpdate;
}