ELD Console Java
 
Loading...
Searching...
No Matches
Generator Class Reference

Stores details about each generator and calculates its cost for a given output. More...

Public Member Functions

 Generator (int gen_id, int min_capacity, int max_capacity, float a, float b, float c)
 The parameterised constructor for Generator class.
 
float calculateCost (float power)
 Calculates the cost for given power based on the cost function of the generator.
 
float validatePower (float power)
 Checks if the given power is within the limits of the generator power capacity.
 
int getGen_id ()
 Getter method for generator id.
 
void setGen_id (int gen_id)
 Setter method for generator id.
 
int getMin_capacity ()
 Getter method for minimum generator capacity.
 
void setMin_capacity (int min_capacity)
 Setter method for minimum generator capacity.
 
int getMax_capacity ()
 Getter method for maximum generator capacity.
 
void setMax_capacity (int max_capacity)
 Setter method for maximum generator capacity.
 
float getA ()
 Returns the quadratic coefficient 'a' of the generator's cost function.
 
void setA (float a)
 Sets the quadratic coefficient 'a' of the generator's cost function.
 
float getB ()
 Returns the linear coefficient 'b' of the generator's cost function.
 
void setB (float b)
 Sets the linear coefficient 'b' of the generator's cost function.
 
float getC ()
 Returns the quadratic coefficient 'c' of the generator's cost function.
 
void setC (float c)
 Sets the quadratic coefficient 'c' of the generator's cost function.
 

Detailed Description

Stores details about each generator and calculates its cost for a given output.

Fields:

  • gen_id — Unique identifier for the generator
  • min_capacity — Minimum generation capacity (in MW)
  • max_capacity — Maximum generation capacity (in MW)
  • a, b, c — Cost function coefficients
  • current_power — Current power output

Methods:

  • Generator(...) — Constructor to initialize generator parameters
  • calculateCost(float power) — Calculates cost for given power
  • isWithinLimits(float power) — Checks if power is within capacity bounds
Author
Sree Sai Nandini
Version
1.0

Constructor & Destructor Documentation

◆ Generator()

Generator.Generator ( int gen_id,
int min_capacity,
int max_capacity,
float a,
float b,
float c )
inline

The parameterised constructor for Generator class.

It initiates an object with required parameters.

Parameters
gen_id(int)- The generator id(a unique identifier)
min_capacity(int) - The minimum power capacity of the generator
max_capacity(int) - The maximum power capacity of the generator
a(float)- the cost coefficient(A) of the generator
b(float)- the cost coefficient(B) of the generator
c(float)- the cost coefficient(C) of the generator

Member Function Documentation

◆ calculateCost()

float Generator.calculateCost ( float power)
inline

Calculates the cost for given power based on the cost function of the generator.

Parameters
powerThe power for which cost needs to be calculated
Returns
C_p the cost for the given power

◆ getA()

float Generator.getA ( )
inline

Returns the quadratic coefficient 'a' of the generator's cost function.

This term represents the fixed cost component.

Returns
the 'a' coefficient

◆ getB()

float Generator.getB ( )
inline

Returns the linear coefficient 'b' of the generator's cost function.

This term scales linearly with power output.

Returns
the 'b' coefficient

◆ getC()

float Generator.getC ( )
inline

Returns the quadratic coefficient 'c' of the generator's cost function.

This term controls how cost curves with power output.

Returns
the 'c' coefficient

◆ getGen_id()

int Generator.getGen_id ( )
inline

Getter method for generator id.

Returns
gen_id Generator id

◆ getMax_capacity()

int Generator.getMax_capacity ( )
inline

Getter method for maximum generator capacity.

Returns
max_capacity Maximum generator capacity

◆ getMin_capacity()

int Generator.getMin_capacity ( )
inline

Getter method for minimum generator capacity.

Returns
min_capacity Minimum generator capacity

◆ setA()

void Generator.setA ( float a)
inline

Sets the quadratic coefficient 'a' of the generator's cost function.

Use this to update the fixed cost component.

Parameters
athe new value for the 'a' coefficient

◆ setB()

void Generator.setB ( float b)
inline

Sets the linear coefficient 'b' of the generator's cost function.

This updates how cost changes linearly with generation.

Parameters
bthe new value for the 'b' coefficient

◆ setC()

void Generator.setC ( float c)
inline

Sets the quadratic coefficient 'c' of the generator's cost function.

Use this to define the rate of cost curvature.

Parameters
cthe new value for the 'c' coefficient

◆ setGen_id()

void Generator.setGen_id ( int gen_id)
inline

Setter method for generator id.

Parameters
gen_idGenerator id

◆ setMax_capacity()

void Generator.setMax_capacity ( int max_capacity)
inline

Setter method for maximum generator capacity.

Parameters
max_capacityMaximum generator capacity

◆ setMin_capacity()

void Generator.setMin_capacity ( int min_capacity)
inline

Setter method for minimum generator capacity.

Parameters
min_capacityMinimum generator capacity

◆ validatePower()

float Generator.validatePower ( float power)
inline

Checks if the given power is within the limits of the generator power capacity.

Parameters
powerthe given power
Returns
true if given power is within the limits, else false

The documentation for this class was generated from the following file: