change edge weight attribute to len
This commit is contained in:
@@ -54,7 +54,7 @@ func (e *weightedLine) SetAttribute(attr encoding.Attribute) error {
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
switch attr.Key {
|
switch attr.Key {
|
||||||
case "weight":
|
case "len":
|
||||||
e.W, err = strconv.ParseFloat(attr.Value, 64)
|
e.W, err = strconv.ParseFloat(attr.Value, 64)
|
||||||
default:
|
default:
|
||||||
err = errors.New("unknown key:" + attr.Key)
|
err = errors.New("unknown key:" + attr.Key)
|
||||||
|
|||||||
Reference in New Issue
Block a user