A ship (1000, 2000) comprising: a power grid; a power cost generator determining power cost; a generator (100, 110, 120) connected to the power grid; an energy storage system (200, 210, ESS1, ESS2, ESS11, ESS12) connected to the power grid; and a load (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) connected to the power grid, characterized in that: the generator (100, 110, 120) is configured to determine whether to produce power based on the power cost, the ESS (200, 210, ESS1, ESS2, ESS11, ESS1 2) is configured to determine whether to store power based on the power cost, and the load (300, 310, 320, 330, LOAD1, LOAD2) is configured to determine whether to use power based on the power cost, wherein the generator (100, 110, 120), the ESS (200, 210, ESS1, ESS2, ESS11, ESS12) and the load (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) are connected to one another via a network configured to transmit the power cost to at least one of the generator, the ESS, and the load, and wherein the power cost is calculated based on at least one of the load's (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) pattern of power consumption, the generator's (100, 110, 120) power production capacity, and the amount of power stored in the ESS (200, 210, ESS1, ESS2, ESS11, ESS12). a power grid; a power cost generator determining power cost; a generator (100, 110, 120) connected to the power grid; an energy storage system (200, 210, ESS1, ESS2, ESS11, ESS12) connected to the power grid; and a load (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) connected to the power grid, characterized in that: the generator (100, 110, 120) is configured to determine whether to produce power based on the power cost, the ESS (200, 210, ESS1, ESS2, ESS11, ESS1 2) is configured to determine whether to store power based on the power cost, and the load (300, 310, 320, 330, LOAD1, LOAD2) is configured to determine whether to use power based on the power cost, wherein the generator (100, 110, 120), the ESS (200, 210, ESS1, ESS2, ESS11, ESS12) and the load (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) are connected to one another via a network configured to transmit the power cost to at least one of the generator, the ESS, and the load, and wherein the power cost is calculated based on at least one of the load's (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) pattern of power consumption, the generator's (100, 110, 120) power production capacity, and the amount of power stored in the ESS (200, 210, ESS1, ESS2, ESS11, ESS12). the generator (100, 110, 120) is configured to determine whether to produce power based on the power cost, the ESS (200, 210, ESS1, ESS2, ESS11, ESS1 2) is configured to determine whether to store power based on the power cost, and the load (300, 310, 320, 330, LOAD1, LOAD2) is configured to determine whether to use power based on the power cost, wherein the generator (100, 110, 120), the ESS (200, 210, ESS1, ESS2, ESS11, ESS12) and the load (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) are connected to one another via a network configured to transmit the power cost to at least one of the generator, the ESS, and the load, and wherein the power cost is calculated based on at least one of the load's (300, 310, 320, 330, LOAD1, LOAD2, LOAD11; LOAD12) pattern of power consumption, the generator's (100, 110, 120) power production capacity, and the amount of power stored in the ESS (200, 210, ESS1, ESS2, ESS11, ESS12).