In one aspect of the present invention, a vehicle comprises: a consumable fuel powered engine, a battery and an electric motor powered by the battery. The battery is rechargeable both from an external electric power source (such as an electric power grid) and from the consumable fuel powered engine. A computer receives data as inputs and providing outputs, wherein the input data includes an expected state of the electric power source at a time when the vehicle is expected to be coupled to the electric power source. The outputs include control signals to control the state of charge of the battery during the time the vehicle is expected to be coupled to the electric power source.