public class

KnapsackSearchNodeImpl

extends Object
implements KnapsackSearchNode
java.lang.Object
   ↳ org.apache.helix.controller.strategy.knapsack.KnapsackSearchNodeImpl

Class Overview

Implementation of KnapsackSearchNode

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

Summary

Public Constructors
KnapsackSearchNodeImpl(KnapsackSearchNode parent, KnapsackAssignment assignment)
Initialize a search node
Public Methods
KnapsackAssignment assignment()
The current node assignment
long currentProfit()
The current profit with this node and search
int depth()
Depth of the node in this search
int nextItemId()
The next item given this node and search
KnapsackSearchNode parent()
The parent node in this search
long profitUpperBound()
The maximum possible profit with this node and search
void setCurrentProfit(long profit)
Set the current profit with this node and search
void setNextItemId(int id)
Set the next item given this node and search
void setProfitUpperBound(long profit)
Set the maximum possible profit with this node and search
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.controller.strategy.knapsack.KnapsackSearchNode

Public Constructors

public KnapsackSearchNodeImpl (KnapsackSearchNode parent, KnapsackAssignment assignment)

Initialize a search node

Parameters
parent the node's parent
assignment the node's assignment

Public Methods

public KnapsackAssignment assignment ()

The current node assignment

Returns
  • KnapsackAssignment instance

public long currentProfit ()

The current profit with this node and search

Returns
  • current profit

public int depth ()

Depth of the node in this search

Returns
  • node depth

public int nextItemId ()

The next item given this node and search

Returns
  • next item id

public KnapsackSearchNode parent ()

The parent node in this search

Returns
  • the node's immediate parent

public long profitUpperBound ()

The maximum possible profit with this node and search

Returns
  • profit upper bound

public void setCurrentProfit (long profit)

Set the current profit with this node and search

Parameters
profit current profit

public void setNextItemId (int id)

Set the next item given this node and search

Parameters
id next item id

public void setProfitUpperBound (long profit)

Set the maximum possible profit with this node and search

Parameters
profit profit upper bound