Direct contributions
This method returns the direct contribution of each process in the system to the total cost result.
$$ q^T * diagm(s) $$
Rest API | GET result/{result-id}/cost-contributions |
JSON-RPC | result/cost-contributions |
Snake case | result.get_cost_contributions |
Camel case | result.getCostContributions |
Return type | List[TechFlowValue] |
Examples
TypeScript IPC
const contributions = await result.getCostContributions();
for (const c of contributions) {
console.log(`${c.techFlow?.provider?.name}: ${c.amount} ${code}`);
}
// Q: 15 USD
// P: 45 USD