Function1D
Stay organized with collections
Save and categorize content based on your preferences.
Function of one argument.
JSON representation |
{
// Union field function can be only one of the following:
"constant": number,
"pwl": {
object (PieceWiseAffineFunction )
}
// End of list of possible types for union field function .
} |
Fields |
Union field function . The unity of the argument of the function is supposed to be: - if a weight: kg - if a time: min - if a number of pallets: 1 function can be only one of the following: |
constant |
number
The function is a constant.
|
pwl |
object (PieceWiseAffineFunction )
The function is piecewise linear.
|
PieceWiseAffineSegment
One segment of a piecewise-linear function.
JSON representation |
{
"startX": number,
"startY": number,
"endX": number,
"endY": number
} |
Fields |
startX |
number
Beginning of the segment: x.
|
startY |
number
Beginning of the segment: y.
|
endX |
number
End of the segment: x.
|
endY |
number
End of the segment: y.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-14 UTC."],[[["\u003cp\u003eThis documentation describes a Function of one argument, which can be either a constant value or a piecewise linear function.\u003c/p\u003e\n"],["\u003cp\u003eIf the function is piecewise linear, it's defined by a series of segments, each represented by a \u003ccode\u003ePieceWiseAffineSegment\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003ePieceWiseAffineSegment\u003c/code\u003e is determined by its starting and ending points (x, y coordinates).\u003c/p\u003e\n"],["\u003cp\u003eThe argument of the function represents different units such as weight (kg), time (min), or number of pallets.\u003c/p\u003e\n"]]],["The `function` can be either a `constant` (a number) or a `pwl` (piecewise linear function). A piecewise-linear function (`pwl`) is defined by an array of `segments`. Each `segment` is described by its `startX`, `startY`, `endX`, and `endY` values. The argument's unit is kg for weight, min for time, or 1 for the number of pallets. These elements allow defining functions of one argument as a constant or piecewise linear.\n"],null,["# Function1D\n\nFunction of one argument.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `function` can be only one of the following: \"constant\": number, \"pwl\": { object (/optimization/middlemileoptimization/reference/rest/v1/Function1D#PieceWiseAffineFunction) } // End of list of possible types for union field `function`. } ``` |\n\n| Fields ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Union field `function`. The unity of the argument of the function is supposed to be: - if a weight: kg - if a time: min - if a number of pallets: 1 `function` can be only one of the following: ||\n| `constant` | `number` The function is a constant. |\n| `pwl` | `object (`[PieceWiseAffineFunction](/optimization/middlemileoptimization/reference/rest/v1/Function1D#PieceWiseAffineFunction)`)` The function is piecewise linear. |\n\nPieceWiseAffineFunction\n-----------------------\n\nPiecewise-linear function, limited to one argument. Design similar to \u003chttps://github.com/google/or-tools/blob/stable/ortools/util/piecewise_linear_function.h\u003e\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"segments\": [ { object (/optimization/middlemileoptimization/reference/rest/v1/Function1D#PieceWiseAffineSegment) } ] } ``` |\n\n| Fields ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `segments[]` | `object (`[PieceWiseAffineSegment](/optimization/middlemileoptimization/reference/rest/v1/Function1D#PieceWiseAffineSegment)`)` Linear segments of the function. |\n\nPieceWiseAffineSegment\n----------------------\n\nOne segment of a piecewise-linear function.\n\n| JSON representation |\n|--------------------------------------------------------------------------------|\n| ``` { \"startX\": number, \"startY\": number, \"endX\": number, \"endY\": number } ``` |\n\n| Fields ||\n|------------|---------------------------------------|\n| `start``X` | `number` Beginning of the segment: x. |\n| `start``Y` | `number` Beginning of the segment: y. |\n| `end``X` | `number` End of the segment: x. |\n| `end``Y` | `number` End of the segment: y. |"]]