Skip to content

Container Cost#1070

Open
skjolber wants to merge 27 commits intomasterfrom
adjustOpenApi
Open

Container Cost#1070
skjolber wants to merge 27 commits intomasterfrom
adjustOpenApi

Conversation

@skjolber
Copy link
Copy Markdown
Owner

@skjolber skjolber commented Nov 3, 2025

Add cost as a dimension of controlledcontainer.

During packaging, select the best next container based on the estimated cost.

@skjolber skjolber changed the title Adjust OpenApi Cost Nov 14, 2025
@skjolber skjolber changed the title Cost Container Cost Nov 14, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds container cost calculation support to the 3D packing library. It introduces a ContainerCostCalculator interface and several implementations (fixed, bucket-based, linear, volume-weight-based), integrates cost calculators into container items, and updates the OpenAPI spec to reflect new cost, resource limit, and temporal limit models.

Changes:

  • New ContainerCostCalculator API interface with fixed, bucket, linear, and volume-weight implementations
  • OpenAPI schema updated: removed StackableItem discriminator pattern, added Cost/WeightCost models, ResourceLimit, TemporalLimit, and PackagerFeature schemas
  • ControlledContainerItem extended with cost calculator support and validation in AbstractPackagerResultBuilder

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
api/.../ContainerCostCalculator.java New interface for container cost calculation
core/.../AbstractBucketWeightContainerCostCalculator.java Abstract base for bucket-based weight cost calculators
core/.../BucketContainerCostCalculator.java Simple weight-bucket cost calculator
core/.../VolumeWeightBucketContainerCostCalculator.java Volume-weight aware bucket cost calculator with builder
core/.../LinearBucketWeightContainerCostCalculator.java Linear per-weight-unit cost calculator
core/.../FixedContainerCostCalculator.java Fixed cost calculator (weight-independent)
core/.../ControlledContainerItem.java Adds cost calculator list to container items
core/.../AbstractPackagerResultBuilder.java Validates all-or-none cost calculator presence
open-api/.../3d-api.yaml Updated API spec with cost, resource limit, temporal limit schemas
core/.../PlainPackagerTest.java Removed unused imports
core/.../BucketContainerCostCalculatorTest.java Tests for bucket cost calculator
core/.../VolumeWeightBucketContainerCostCalculatorTest.java Tests for volume-weight bucket calculator
core/.../LinearBucketWeightContainerCostCalculatorTest.java Tests for linear cost calculator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread open-api/open-api-model/src/main/resources/3d-api.yaml Outdated
Comment on lines +308 to +329






















skjolber and others added 4 commits March 16, 2026 00:52
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants