class_docstr: Container for the target function run information.
  
  Most importantly, the runhistory contains an efficient mapping from each evaluated configuration to the
  empirical cost observed on either the full instance set or a subset. The cost is the average over all
  observed costs for one configuration:
  
  * If using budgets for a single instance, only the cost on the highest observed budget is returned.
  * If using instances as the budget, the average cost over all evaluated instances is returned.
  * Theoretically, the runhistory object can handle instances and budgets at the same time. This is
    neither used nor tested.
  
  Note
  ----
  Guaranteed to be picklable.
  
  Parameters
  ----------
  multi_objective_algorithm : AbstractMultiObjectiveAlgorithm | None, defaults to None
      The multi-objective algorithm is required to scalarize the costs in case of multi-objective.
  overwrite_existing_trials : bool, defaults to false
      Overwrites a trial (combination of configuration, instance, budget and seed) if it already exists.
docstr: Incrementally updates the performance of a configuration by using a moving average.
  
  Parameters
  ----------
  config: Configuration
      configuration to update cost based on all trials in runhistory
  cost: float
      cost of new run of config
docstr_tok: ["Incrementally","updates","the","performance","of","a","configuration","by","using","a","moving","average",".","Parameters","--","--","--","--","--","config",":","Configuration","configuration","to","update","cost","based","on","all","trials","in","runhistory","cost",":","float","cost","of","new","run","of","config"]
code: def incremental_update_cost(
      self, config: Configuration, cost: float | list[float]
  ) -> None:
      """Incrementally updates the performance of a configuration by using a moving average.
  
      Parameters
      ----------
      config: Configuration
          configuration to update cost based on all trials in runhistory
      cost: float
          cost of new run of config
      """
      config_id = self._config_ids[config]
      n_trials = self._num_trials_per_config.get(config_id, 0)
  
      if self._n_objectives > 1:
          costs = np.array(cost)
          old_costs = self._cost_per_config.get(
              config_id,
              np.array([0.0 for _ in range(self._n_objectives)]),
          )
          old_costs = np.array(old_costs)
  
          new_costs = ((old_costs * n_trials) + costs) / (n_trials + 1)
          self._cost_per_config[config_id] = new_costs.tolist()
      else:
          old_cost = self._cost_per_config.get(config_id, 0.0)
  
          assert isinstance(cost, float)
          assert isinstance(old_cost, float)
          self._cost_per_config[config_id] = (
              (old_cost * n_trials) + cost
          ) / (n_trials + 1)
  
      self._num_trials_per_config[config_id] = n_trials + 1
  
imports: from __future__ import annotations
  from typing import Any, Iterable, Iterator, Mapping, cast
  import json
  from collections import OrderedDict
  from pathlib import Path
  import numpy
  from ConfigSpace import Configuration, ConfigurationSpace
  from smac.constants import MAXINT
  from smac.multi_objective.abstract_multi_objective_algorithm import AbstractMultiObjectiveAlgorithm
  from smac.runhistory.dataclasses import InstanceSeedBudgetKey, InstanceSeedKey, TrialInfo, TrialKey, TrialValue
  from smac.runhistory.enumerations import StatusType
  from smac.utils.configspace import get_config_hash
  from smac.utils.logging import get_logger
  from smac.utils.multi_objective import normalize_costs
label_desc: Use image node_id 21 for calling the RunHistory obj's underlying member method code with example usage: obj.incremental_update_cost(config, cost) without return types