3.47 symbol : Declare item

Format

Format 1)

$obj$.symbol($itemName,value,to$) $\rightarrow $ $Qtrue$

  $itemName$ : string

  $value$ : float

  $to$ : string

Format 2)

$obj$.symbol $\rightarrow $ $itemList$

  $itemList$ : string

Description

The 3 features of the symbol function are as follows.

  1. Specify the variable (item) in corresponding order from the root of the binary decision graph to the end node in the ZDD structure. 1 item can be declared by the symbol function each time, and can be added to the end or beginning of the item table stored internally.

  2. Set name of item. Any characters can be used in item name.

  3. Set the cost of item attribute.

Format 1)

Declare the name of item at $itemName$. There is no particular restriction to the character type for item name nor the length of character string (except for limitation in memory capacity).

$value$ assigns cost to an item used in cost and maxcover methods. When not specified, the default value is set at 0.5.

$to$ specifies whether to add the declared item to the top or bottom of the item order table ("top" or "bottom"). When the value is not specified, default value is set to "bottom".

Format 2)

When the symbol method is used without arguments, it returns a list of space delimited symbol variables.

Example

> ZDD.symbol("a",1.0)
> ZDD.symbol("b",0.5)
> ZDD.symbol("c",2.0,"top")
> ZDD.symbol("d")
> ZDD.symbol
c a  b  d

> (1..10).each{|i|
>   ZDD.symbol("s_#{i}",i)
> }
> puts  ZDD.symbol
c a b d s_1 s_2 s_3 s_4 s_5 s_6 s_7 s_8 s_9 s_10


See Also

itemset : Create ZDD objects for itemsets.

cost : Calculate total cost of itemsets.