protected override void InternalDeserialize(object data)
        {
            var variablesCopy = Variables.Values.OfType <OrToolsVariable>().ToArray();

            foreach (var variable in variablesCopy)
            {
                var solverVariable = Solver.LookupVariableOrNull(variable.Name);
                if (solverVariable != null)
                {
                    variable.Variable = solverVariable;
                }
                else
                {
                    Variables.Remove(variable.Name);
                }
            }
            foreach (var goal in Goals.ToArray())
            {
                AddGoal(goal.Key, goal.Value);
            }
        }