(physics, reward)
Sets the highlight, effector and target colors according to the reward.
Sets the highlight, effector and target colors according to the reward.
Sets the highlight effector and target colors according to the reward .
def _set_reward_colors(physics, reward):
  """Sets the highlight, effector and target colors according to the reward."""
  assert 0.0 <= reward <= 1.0
  colors = physics.named.model.mat_rgba
  default = colors[_DEFAULT]
  highlight = colors[_HIGHLIGHT]
  blend_coef = reward ** 4  # Better color distinction near high rewards.
  colors[_MATERIALS] = blend_coef * highlight + (1.0 - blend_coef) * default
def _set_reward_colors ( physics , reward ) : assert 0.0 <= reward <= 1.0 colors = physics . named . model . mat_rgba default = colors [ _DEFAULT ] highlight = colors [ _HIGHLIGHT ] blend_coef = reward ** 4 # Better color distinction near high rewards. colors [ _MATERIALS ] = blend_coef * highlight + ( 1.0 - blend_coef ) * default