IntrospectiveSystems / xGraph

Introspective Systems, developer of xGraph, collaborative AI platform for data systems
https://www.introspectivesystems.com/
GNU Affero General Public License v3.0
14 stars 3 forks source link

Allow for math in Pars in config #146

Open oceanlumberjack opened 5 years ago

oceanlumberjack commented 5 years ago

Modify the way that configs are processed to allow simple math (+,-,/,*) in the Par declaration of a config.JSON.

{
    "Sources": {
        "xgraph": "{xgraph}"
    },
    "Modules": {
        "Module": {
            "Module": "Modules.Module",
            "Source": "xgraph",
            "Par": {
                "Parameter": 1/100
            }
        },
        "Deferred": []
    }
}
tjgionet commented 4 years ago

Could make it a string to eval. Have some type of header “FUN: 1/100” Then calculate anything in the string after FUN:

Could then define

TIME: “FUN: Date.now()”