Interface INodeConstraint<TLayout, TNode, TConfiguration, TEnergyData>
Represents a node constraint.
Namespace: Edgar.Legacy.Core.Constraints.Interfaces
Assembly: Edgar.dll
Syntax
public interface INodeConstraint<in TLayout, in TNode, in TConfiguration, TEnergyData>
Type Parameters
Name | Description |
---|---|
TLayout | |
TNode | |
TConfiguration | |
TEnergyData |
Methods
ComputeEnergyData(TLayout, TNode, TConfiguration, ref TEnergyData)
Computes energy data for a given node.
Declaration
bool ComputeEnergyData(TLayout layout, TNode node, TConfiguration configuration, ref TEnergyData energyData)
Parameters
Type | Name | Description |
---|---|---|
TLayout | layout | Current layout. |
TNode | node | Node for which an energy data should be computed. |
TConfiguration | configuration | Current configuration of the node. |
TEnergyData | energyData | Energy data to be modified. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the configuration is valid for a given node. |
UpdateEnergyData(TLayout, TLayout, TNode, ref TEnergyData)
Updates energy data of a perturbed node.
Declaration
bool UpdateEnergyData(TLayout oldLayout, TLayout newLayout, TNode node, ref TEnergyData energyData)
Parameters
Type | Name | Description |
---|---|---|
TLayout | oldLayout | Old layout. |
TLayout | newLayout | New layout with all other configurations and energy data already updated. |
TNode | node | Node for which an energy data should be computed. |
TEnergyData | energyData | Energy data to be modified. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the configuration is valid for a given node. |
Remarks
The idea of this method is the same as of the overload above.
UpdateEnergyData(TLayout, TNode, TConfiguration, TConfiguration, TNode, TConfiguration, ref TEnergyData)
Updates energy data of a given node based on a perturbed node.
Declaration
bool UpdateEnergyData(TLayout layout, TNode perturbedNode, TConfiguration oldConfiguration, TConfiguration newConfiguration, TNode node, TConfiguration configuration, ref TEnergyData energyData)
Parameters
Type | Name | Description |
---|---|---|
TLayout | layout | Current node. |
TNode | perturbedNode | Node that was perturbed. |
TConfiguration | oldConfiguration | Old configuration of the perturbed node. |
TConfiguration | newConfiguration | New configuration of the perturbed node. |
TNode | node | Node for which an energy data should be computed. |
TConfiguration | configuration | Current configuration of the node. |
TEnergyData | energyData | Energy data to be modified. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the configuration is valid for a given node. |
Remarks
This method is used to speedup the computation. It would have a complexity of O(n^2) (n being the number of vertices) if all vertices needed all other vertices to compute their energy data. But it can be computed in O(n) if we change only relevant data and do not compute it all again. To support this method, energy data often hold all the information needed to make this kind of update.