en-us/CPolydorou.AdvancedAlgorithms-help.xml
<?xml version="1.0" encoding="utf-8"?><helpItems schema="maml">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <!--Generated by PS Cmdlet Help Editor--> <command:details> <command:name>Get-Knapsack</command:name> <maml:description> <maml:para>A solution to the 0-1 Knapsack problem.</maml:para> </maml:description> <maml:copyright> <maml:para /> </maml:copyright> <command:verb>Get</command:verb> <command:noun>Knapsack</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Find the optimal selection between items with specific weight and value</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-Knapsack</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>KnapsackSize</maml:name> <maml:description> <maml:para>The size of the Knapsack.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="true (ByValue)" position="named"> <maml:name>Items</maml:name> <maml:description> <maml:para>The items to make the selection from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">PSObject[]</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>WeightPropertyName</maml:name> <maml:description> <maml:para>The name of the property to use for the weight.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValuePropertyName</maml:name> <maml:description> <maml:para>The name of the property to use for the value.</maml:para> <maml:para>If ommited, the WeightPropertyName will be used instead.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>KnapsackSize</maml:name> <maml:description> <maml:para>The size of the Knapsack.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="true (ByValue)" position="named"> <maml:name>Items</maml:name> <maml:description> <maml:para>The items to make the selection from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">PSObject[]</command:parameterValue> <dev:type> <maml:name>PSObject[]</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>WeightPropertyName</maml:name> <maml:description> <maml:para>The name of the property to use for the weight.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValuePropertyName</maml:name> <maml:description> <maml:para>The name of the property to use for the value.</maml:para> <maml:para>If ommited, the WeightPropertyName will be used instead.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name></maml:name> <maml:uri></maml:uri> <maml:description/> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name></maml:name> <maml:uri></maml:uri> <maml:description/> </dev:type> <maml:description> <maml:para /> </maml:description> </command:returnValue> </command:returnValues> <command:terminatingErrors></command:terminatingErrors> <command:nonTerminatingErrors></command:nonTerminatingErrors> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para /> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <maml:introduction> <maml:paragraph>PS C:\></maml:paragraph> </maml:introduction> <dev:code>$items = New-Object -TypeName System.Collections.ArrayList $obj1 = New-Object -TypeName PSObject ` -Property @{Value = 60; Weight = 10} $items.Add($obj1) | Out-Null $obj2 = New-Object -TypeName PSObject ` -Property @{Value = 100; Weight = 20} $items.Add($obj2) | Out-Null $obj3 = New-Object -TypeName PSObject ` -Property @{Value = 120; Weight = 30} $items.Add($obj3) | Out-Null Get-Knapsack -KnapsackSize 50 ` -Items $items ` -WeightPropertyName Weight ` -ValuePropertyName Value</dev:code> <dev:remarks> <maml:para>Create a collection of items and make the optimal selection.</maml:para> <maml:para /> <maml:para /> <maml:para>Value Weight ----- ------ 100 20 60 10</maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText> <maml:para /> </command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <maml:introduction> <maml:paragraph>PS C:\></maml:paragraph> </maml:introduction> <dev:code>$items = New-Object -TypeName System.Collections.ArrayList $obj1 = New-Object -TypeName PSObject ` -Property @{Value = 60; Weight = 10} $items.Add($obj1) | Out-Null $obj2 = New-Object -TypeName PSObject ` -Property @{Value = 100; Weight = 20} $items.Add($obj2) | Out-Null $obj3 = New-Object -TypeName PSObject ` -Property @{Value = 120; Weight = 30} $items.Add($obj3) | Out-Null $items | Get-Knapsack -KnapsackSize 50 ` -WeightPropertyName Weight ` -ValuePropertyName Value</dev:code> <dev:remarks> <maml:para>Create a collection of items and use the pipeline to make the optimal selection.</maml:para> <maml:para /> <maml:para /> <maml:para>Value Weight ----- ------ 100 20 60 10</maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText> <maml:para /> </command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <maml:relatedLinks> </maml:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <!--Generated by PS Cmdlet Help Editor--> <command:details> <command:name>Get-BinPacking</command:name> <maml:description> <maml:para>A solution to the 0-1 Knapsack problem.</maml:para> </maml:description> <maml:copyright> <maml:para /> </maml:copyright> <command:verb>Get</command:verb> <command:noun>BinPacking</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Find the optimal selection between items with specific weight in order to seperate them into bins.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-BinPacking</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>BinSize</maml:name> <maml:description> <maml:para>The size of the bins.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="true (ByValue)" position="named"> <maml:name>Items</maml:name> <maml:description> <maml:para>The collection of items to seperate into bins.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">PSObject[]</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>WeightPropertyName</maml:name> <maml:description> <maml:para>The name of the property to use for the weight.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Method</maml:name> <maml:description> <maml:para> The bin packing method to use.</maml:para> <maml:para> The available methods are: BestFit, FirstFit, NextFit. In no value is specified, the calculation will be performed for all methods and the best solution will be returned. </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>BinSize</maml:name> <maml:description> <maml:para>The size of the bins.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="true (ByValue)" position="named"> <maml:name>Items</maml:name> <maml:description> <maml:para>The collection of items to seperate into bins.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">PSObject[]</command:parameterValue> <dev:type> <maml:name>PSObject[]</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>WeightPropertyName</maml:name> <maml:description> <maml:para>The name of the property to use for the weight.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Method</maml:name> <maml:description> <maml:para> The bin packing method to use.</maml:para> <maml:para> The available methods are: BestFit, FirstFit, NextFit. In no value is specified, the calculation will be performed for all methods and the best solution will be returned. </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri/> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name></maml:name> <maml:uri></maml:uri> <maml:description/> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name></maml:name> <maml:uri></maml:uri> <maml:description/> </dev:type> <maml:description> <maml:para /> </maml:description> </command:returnValue> </command:returnValues> <command:terminatingErrors></command:terminatingErrors> <command:nonTerminatingErrors></command:nonTerminatingErrors> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para /> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <maml:introduction> <maml:paragraph>PS C:\></maml:paragraph> </maml:introduction> <dev:code> $items = New-Object -TypeName System.Collections.ArrayList $obj1 = New-Object -TypeName PSObject ` -Property @{Name = "Item1"; Weight = 10} $items.Add($obj1) | Out-Null $obj2 = New-Object -TypeName PSObject ` -Property @{Name = "Item2"; Weight = 20} $items.Add($obj2) | Out-Null $obj3 = New-Object -TypeName PSObject ` -Property @{Name = "Item3"; Weight = 30} $items.Add($obj3) | Out-Null Get-BinPacking -BinSize 50 ` -Items $items ` -WeightPropertyName Weight </dev:code> <dev:remarks> <maml:para>Create a collection of items and make the optimal selection.</maml:para> <maml:para /> <maml:para /> <maml:para> Bin Size Items --- ---- ----- 0 30 {@{Weight=10; Name=Item1}, @{Weight=20; Name=Item2}} 1 30 {@{Weight=30; Name=Item3}} </maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText> <maml:para /> </command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <maml:introduction> <maml:paragraph>PS C:\></maml:paragraph> </maml:introduction> <dev:code> $items = New-Object -TypeName System.Collections.ArrayList $obj1 = New-Object -TypeName PSObject ` -Property @{Name = "Item1"; Weight = 10} $items.Add($obj1) | Out-Null $obj2 = New-Object -TypeName PSObject ` -Property @{Name = "Item2"; Weight = 20} $items.Add($obj2) | Out-Null $obj3 = New-Object -TypeName PSObject ` -Property @{Name = "Item3"; Weight = 30} $items.Add($obj3) | Out-Null $items | Get-BinPacking -BinSize 50 ` -WeightPropertyName Weight </dev:code> <dev:remarks> <maml:para>Create a collection of items and use the pipeline make the optimal selection.</maml:para> <maml:para /> <maml:para /> <maml:para> Bin Size Items --- ---- ----- 0 30 {@{Weight=10; Name=Item1}, @{Weight=20; Name=Item2}} 1 30 {@{Weight=30; Name=Item3}} </maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText> <maml:para /> </command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <maml:relatedLinks> </maml:relatedLinks> </command:command> </helpItems> |