public interface

KnapsackSearchNode

org.apache.helix.controller.strategy.knapsack.KnapsackSearchNode
Known Indirect Subclasses

Class Overview

Description of a knapsack element during the search process

Based on the C++ knapsack solver in Google's or-tools package.

Summary

Public Methods
abstract KnapsackAssignment assignment()
The current node assignment
abstract long currentProfit()
The current profit with this node and search
abstract int depth()
Depth of the node in this search
abstract int nextItemId()
The next item given this node and search
abstract KnapsackSearchNode parent()
The parent node in this search
abstract long profitUpperBound()
The maximum possible profit with this node and search
abstract void setCurrentProfit(long profit)
Set the current profit with this node and search
abstract void setNextItemId(int id)
Set the next item given this node and search
abstract void setProfitUpperBound(long profit)
Set the maximum possible profit with this node and search

Public Methods

public abstract KnapsackAssignment assignment ()

The current node assignment

Returns
  • KnapsackAssignment instance

public abstract long currentProfit ()

The current profit with this node and search

Returns
  • current profit

public abstract int depth ()

Depth of the node in this search

Returns
  • node depth

public abstract int nextItemId ()

The next item given this node and search

Returns
  • next item id

public abstract KnapsackSearchNode parent ()

The parent node in this search

Returns
  • the node's immediate parent

public abstract long profitUpperBound ()

The maximum possible profit with this node and search

Returns
  • profit upper bound

public abstract void setCurrentProfit (long profit)

Set the current profit with this node and search

Parameters
profit current profit

public abstract void setNextItemId (int id)

Set the next item given this node and search

Parameters
id next item id

public abstract void setProfitUpperBound (long profit)

Set the maximum possible profit with this node and search

Parameters
profit profit upper bound