16 package emlab.gen.role.operating;
18 import org.springframework.beans.factory.annotation.Autowired;
19 import org.springframework.transaction.annotation.Transactional;
21 import agentspring.role.Role;
22 import agentspring.role.RoleComponent;
28 import emlab.gen.role.AbstractEnergyProducerRole;
38 public class PayCO2TaxRole extends AbstractEnergyProducerRole implements Role<EnergyProducer> {
43 public Reps getReps() {
50 logger.info(
"Pay the CO2 tax");
52 Government government = reps.genericRepository.findFirst(Government.class);
55 double money = calculateCO2Tax(plant,
false, getCurrentTick());
56 CashFlow cf = reps.nonTransactionalCreateRepository.createCashFlow(producer, government, money, CashFlow.CO2TAX, getCurrentTick(), plant);
57 logger.info(
"Cash flow created: {}", cf);
Iterable< PowerPlant > findOperationalPowerPlantsByOwner(@Param("owner") EnergyProducer owner,@Param("tick") long tick)