Abstract
A computer-implemented method for generating at least one weighted training example for training a behavior planner for an at least partially automatically driving vehicle or a robot, wherein each training example is a tuple of a state and a corresponding specified target behavior. The method includes: extracting a state from a pre-provided initial training example as the initial state; rolling out a planning strategy of the behavior planner starting from the initial state within a simulation for generating a simulated behavior; terminating the simulation based on a termination condition; evaluating the initial state and/or a state encountered by the simulated behavior in the simulation; weighting a training example on the based on the evaluation of its state and/or at least one state encountered by the simulated behavior after this, wherein the training example is the initial training example and/or a training example newly generated based on an encountered state.