Direct process results
This method returns the direct intervention flows related to the production of a product (or treatment of a waste) of a process \(j\) in order to fulfill the demand of the product system. Mathematically, it is the column \(j\) of the scaled intervention matrix \(G\):
$$ G = B * diag(s) $$
REST | GET result/{result-id}/direct-flows-of/{tech-flow} |
IPC | result/direct-flows-of |
Python IPC | Result.get_direct_flows_of |
Return type | List[EnviFlowValue] |
Parameter type | TechFlow |
It is also possible to get the direct result of a single flow \(i\):
REST | GET result/{result-id}/direct-flow-of/{envi-flow}/{tech-flow} |
IPC | result/direct-flow-of |
Python IPC | Result.get_direct_flow_of |
Return type | EnviFlowValue |
Parameter type | EnviFlow |
Parameter type | TechFlow |
Examples
JSON-RPC via Fetch API
The example below shows the usage of this method using the JSON-RPC protocol via the Fetch API which is available in modern web-browsers or platforms like Deno.
let resp = await fetch("http://localhost:8080", {
method: "POST",
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "result/direct-flows-of",
params: {
"@id": "66dcc7d0-ce47-46bf-b77a-ada4b4c95169",
techFlow: {
provider: {
"@type": "Process",
"@id": "ff6b1c80-03b2-4433-adaf-66c51063b078",
},
flow: {
"@type": "Flow",
"@id": "759b89bd-3aa6-42ad-b767-5bb9ef5d331d",
}
}
}
})
});
let v = await resp.json();
console.log(v);
// {
// jsonrpc: "2.0",
// result: [
// { enviFlow: { flow: [Object], isInput: false },
// amount: 2.4884640352310415e-19 },
// { enviFlow: { flow: [Object], isInput: false },
// amount: 1.0147225898077544e-12 }, ...