NewModelFromString creates a model from a string which contains model text.
(text string)
| 149 | |
| 150 | // NewModelFromString creates a model from a string which contains model text. |
| 151 | func NewModelFromString(text string) (Model, error) { |
| 152 | m := NewModel() |
| 153 | |
| 154 | err := m.LoadModelFromText(text) |
| 155 | if err != nil { |
| 156 | return nil, err |
| 157 | } |
| 158 | |
| 159 | return m, nil |
| 160 | } |
| 161 | |
| 162 | // LoadModel loads the model from model CONF file. |
| 163 | func (model Model) LoadModel(path string) error { |
searching dependent graphs…