org.apache.sysds.hops.cost

## Class FederatedCost

- java.lang.Object
- - org.apache.sysds.hops.cost.FederatedCost

    public class FederatedCost
    extends Object

Class storing execution cost estimates for federated executions with cost estimates split into different categories such as compute, read, and transfer cost.

### Constructor Summary

Constructors
Constructor and Description
`FederatedCost()`
`FederatedCost(double readCost, double inputTransferCost, double outputTransferCost, double computeCost, double inputTotalCost)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addFederatedCost(FederatedCost additionalCost)` Add costs of FederatedCost object to this object's current costs.
`void` `addInputTotalCost(double additionalCost)` Add cost to the stored input cost.
`void` `addInputTotalCost(FederatedCost federatedCost)` Add total of federatedCost to stored inputTotalCost.
`void` `addRepetitionCost(int repetitionNumber)` Multiply the input costs by the number of times the costs are repeated.
`double` `getInputTotalCost()` Get summed input costs.
`double` `getTotal()` Get the total sum of costs stored in this object.
`void` `setInputTotalCost(double inputTotalCost)`
`String` `toString()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### FederatedCost

    public FederatedCost()

#### FederatedCost

    public FederatedCost(double readCost,
                         double inputTransferCost,
                         double outputTransferCost,
                         double computeCost,
                         double inputTotalCost)

### Method Detail

#### getTotal

    public double getTotal()

Get the total sum of costs stored in this object.

Returns:
  total cost

#### addRepetitionCost

    public void addRepetitionCost(int repetitionNumber)

Multiply the input costs by the number of times the costs are repeated.

Parameters:
  `repetitionNumber` - number of repetitions of the costs

#### getInputTotalCost

    public double getInputTotalCost()

Get summed input costs.

Returns:
  summed input costs

#### setInputTotalCost

    public void setInputTotalCost(double inputTotalCost)

#### addInputTotalCost

    public void addInputTotalCost(double additionalCost)

Add cost to the stored input cost.

Parameters:
  `additionalCost` - to add to total input cost

#### addInputTotalCost

    public void addInputTotalCost(FederatedCost federatedCost)

Add total of federatedCost to stored inputTotalCost.

Parameters:
  `federatedCost` - input cost from which the total is retrieved

#### addFederatedCost

    public void addFederatedCost(FederatedCost additionalCost)

Add costs of FederatedCost object to this object's current costs.

Parameters:
  `additionalCost` - object to add to this object

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`