Skip to content

Commit

Permalink
starts to add annual adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
liamlaverty committed Mar 27, 2024
1 parent 7cc85f0 commit decdfd8
Show file tree
Hide file tree
Showing 8 changed files with 414 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ public void TestCalculator()
var _calc = new Calculator();

var result = _calc.CalculateAttainedCiiRating(
ShipType.BulkCarrier,
1000,
1000,
1000,
TypeOfFuel.HEAVYFUELOIL,
1000);
ShipType.RoRoPassengerShip,
grossTonnage: 25000,
deadweightTonnage: 0,
distanceTravelled: 150000,
TypeOfFuel.DIESEL_OR_GASOIL,
fuelConsumption: 1.9e+10
);

Assert.AreNotEqual(ImoCiiRating.ERR, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public void TestValidateTonnageParamsSet_ArgumentOutOfRangeException(ShipType sh
[DataRow(ShipType.RefrigeratedCargoCarrier, 250000, 0, 250000)]
[DataRow(ShipType.CombinationCarrier, 250000, 0, 250000)]
[DataRow(ShipType.LngCarrier, 250000, 0, 250000)]
[DataRow(ShipType.RoRoCargoShip, 250000, 0, 250000)]
[DataRow(ShipType.RoRoCargoShip, 0, 250000, 250000)]
[DataRow(ShipType.RoRoPassengerShip_HighSpeedSOLAS, 0, 250000, 250000)]
[DataRow(ShipType.RoRoCargoShipVehicleCarrier, 0, 100000, 100000)]
[DataRow(ShipType.RoRoPassengerShip, 0, 100000, 100000)]
[DataRow(ShipType.RoRoCruisePassengerShip, 0, 100000, 100000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,27 @@ public Calculator()
_carbonIntensityIndicatorService = new CarbonIntensityIndicatorCalculatorService();
}


/// <summary>
///
/// </summary>
/// <param name="shipType"></param>
/// <param name="grossTonnage">in long-tons</param>
/// <param name="deadweightTonnage">in long-tons</param>
/// <param name="distanceTravelled">distance travelled in nautical miles</param>
/// <param name="fuelType"></param>
/// <param name="fuelConsumption">quantity of fuel consumed in grams</param>
/// <returns></returns>
public ImoCiiRating CalculateAttainedCiiRating(ShipType shipType, double grossTonnage, double deadweightTonnage, double distanceTravelled, TypeOfFuel fuelType, double fuelConsumption)
{
var shipCo2Emissions = _shipMassOfCo2EmissionsService.GetMassOfCo2Emissions(fuelType, fuelConsumption);
var shipCapacity = _shipCapacityService.GetShipCapacity(shipType, grossTonnage, deadweightTonnage);
var shipCapacity = _shipCapacityService.GetShipCapacity(shipType, deadweightTonnage, grossTonnage);
var transportWork = _shipTransportWorkService.GetShipTransportWork(shipCapacity, distanceTravelled);
var attainedCii = _carbonIntensityIndicatorService.GetAttainedCarbonIntensity(shipCo2Emissions, transportWork);
var requiredCii = _carbonIntensityIndicatorService.GetRequiredCarbonIntensity(shipType, shipCapacity, 2019);

var attainedRequiredRatio = attainedCii / requiredCii;



return ImoCiiRating.ERR;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public enum ShipType
/// </summary>
/// <seealso cref="RoRoCruisePassengerShip"/>
RoRoPassengerShip = 110,

/// <summary>
/// A type of high-speed ship designed to conform to SOLAS Chapter X standards
/// </summary>
/// <seealso cref="RoRoCruisePassengerShip"/>
RoRoPassengerShip_HighSpeedSOLAS = 111,

/// <summary>
/// A type of ship designed primarily for passenger accommodation and leisure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namespace EtiveMor.OpenImoCiiCalculator.Core.Services
using EtiveMor.OpenImoCiiCalculator.Core.Models.Enums;

namespace EtiveMor.OpenImoCiiCalculator.Core.Services
{
public interface ICarbonIntensityIndicatorCalculatorService
{
double GetAttainedCarbonIntensity(double massOfCo2Emissions, double transportWork);
void GetReferenceCarbonIntensity();
double GetRequiredCarbonIntensity(ShipType shipType, double capacity, int year);
Dictionary<int, double> GetRequiredCarbonIntensity(ShipType shipType, double capacity);
}
}
Loading

0 comments on commit decdfd8

Please sign in to comment.