{
 "$schema": "../../lib/umlimator.schema.json",
 "schemaVersion": 2,
 "title": "Parametric diagram",
 "root": "range",
 "nodes": [
  {
   "id": "ebike",
   "type": "sysml.Block",
   "label": "EBike",
   "members": [
    {
     "id": "ebike.battery",
     "type": "sysml.PartProperty",
     "label": "battery",
     "props": {
      "valueType": "Battery",
      "multiplicity": "1"
     }
    },
    {
     "id": "ebike.controller",
     "type": "sysml.PartProperty",
     "label": "controller",
     "props": {
      "valueType": "Controller",
      "multiplicity": "1"
     }
    },
    {
     "id": "ebike.motor",
     "type": "sysml.PartProperty",
     "label": "motor",
     "props": {
      "valueType": "Motor",
      "multiplicity": "1"
     }
    },
    {
     "id": "ebike.frontLight",
     "type": "sysml.PartProperty",
     "label": "frontLight",
     "props": {
      "valueType": "Light",
      "multiplicity": "1"
     }
    },
    {
     "id": "ebike.rearLight",
     "type": "sysml.PartProperty",
     "label": "rearLight",
     "props": {
      "valueType": "Light",
      "multiplicity": "1"
     }
    },
    {
     "id": "ebike.dock",
     "type": "sysml.ReferenceProperty",
     "label": "dock",
     "props": {
      "valueType": "Dock",
      "multiplicity": "0..1"
     }
    },
    {
     "id": "ebike.batteryCapacity",
     "type": "sysml.ValueProperty",
     "label": "batteryCapacity",
     "props": {
      "valueType": "Energy"
     }
    },
    {
     "id": "ebike.usableShare",
     "type": "sysml.ValueProperty",
     "label": "usableShare",
     "props": {
      "valueType": "Real"
     }
    },
    {
     "id": "ebike.ecoConsumption",
     "type": "sysml.ValueProperty",
     "label": "ecoConsumption",
     "props": {
      "valueType": "EnergyPerDistance"
     }
    },
    {
     "id": "ebike.boostConsumption",
     "type": "sysml.ValueProperty",
     "label": "boostConsumption",
     "props": {
      "valueType": "EnergyPerDistance"
     }
    },
    {
     "id": "ebike.ecoRange",
     "type": "sysml.ValueProperty",
     "label": "ecoRange",
     "props": {
      "valueType": "Distance"
     }
    },
    {
     "id": "ebike.boostRange",
     "type": "sysml.ValueProperty",
     "label": "boostRange",
     "props": {
      "valueType": "Distance"
     }
    },
    {
     "id": "ebike.usable",
     "type": "sysml.ConstraintProperty",
     "label": "usable",
     "props": {
      "valueType": "UsableEnergy"
     }
    },
    {
     "id": "ebike.eco",
     "type": "sysml.ConstraintProperty",
     "label": "eco",
     "props": {
      "valueType": "RangeEquation"
     }
    },
    {
     "id": "ebike.boost",
     "type": "sysml.ConstraintProperty",
     "label": "boost",
     "props": {
      "valueType": "RangeEquation"
     }
    }
   ]
  },
  {
   "id": "usable-energy",
   "type": "sysml.ConstraintBlock",
   "label": "UsableEnergy",
   "props": {
    "constraint": "usable = capacity * share"
   },
   "members": [
    {
     "id": "usable-energy.usable",
     "type": "sysml.ConstraintParameter",
     "label": "usable",
     "props": {
      "valueType": "Energy"
     }
    },
    {
     "id": "usable-energy.capacity",
     "type": "sysml.ConstraintParameter",
     "label": "capacity",
     "props": {
      "valueType": "Energy"
     }
    },
    {
     "id": "usable-energy.share",
     "type": "sysml.ConstraintParameter",
     "label": "share",
     "props": {
      "valueType": "Real"
     }
    }
   ]
  },
  {
   "id": "range-equation",
   "type": "sysml.ConstraintBlock",
   "label": "RangeEquation",
   "props": {
    "constraint": "range = energy / consumption"
   },
   "members": [
    {
     "id": "range-equation.range",
     "type": "sysml.ConstraintParameter",
     "label": "range",
     "props": {
      "valueType": "Distance"
     }
    },
    {
     "id": "range-equation.energy",
     "type": "sysml.ConstraintParameter",
     "label": "energy",
     "props": {
      "valueType": "Energy"
     }
    },
    {
     "id": "range-equation.consumption",
     "type": "sysml.ConstraintParameter",
     "label": "consumption",
     "props": {
      "valueType": "EnergyPerDistance"
     }
    }
   ]
  },
  {
   "id": "trip-range",
   "type": "sysml.ConstraintBlock",
   "label": "TripRange",
   "props": {
    "constraint": "tripRange = batteryEnergy * usableShare / rate"
   },
   "members": [
    {
     "id": "trip-range.capacity",
     "type": "sysml.ConstraintParameter",
     "label": "batteryEnergy",
     "props": {
      "valueType": "Energy"
     }
    },
    {
     "id": "trip-range.share",
     "type": "sysml.ConstraintParameter",
     "label": "usableShare",
     "props": {
      "valueType": "Real"
     }
    },
    {
     "id": "trip-range.consumption",
     "type": "sysml.ConstraintParameter",
     "label": "rate",
     "props": {
      "valueType": "EnergyPerDistance"
     }
    },
    {
     "id": "trip-range.range",
     "type": "sysml.ConstraintParameter",
     "label": "tripRange",
     "props": {
      "valueType": "Distance"
     }
    },
    {
     "id": "trip-range.usable",
     "type": "sysml.ConstraintProperty",
     "label": "usable",
     "props": {
      "valueType": "UsableEnergy"
     }
    },
    {
     "id": "trip-range.trip",
     "type": "sysml.ConstraintProperty",
     "label": "trip",
     "props": {
      "valueType": "RangeEquation"
     }
    }
   ]
  }
 ],
 "edges": [
  {
   "id": "bind-capacity",
   "type": "sysml.BindingConnector",
   "from": "ebike.batteryCapacity",
   "to": "usable-energy.capacity",
   "props": {
    "ends": {
     "to": {
      "part": "ebike.usable"
     }
    }
   }
  },
  {
   "id": "bind-share",
   "type": "sysml.BindingConnector",
   "from": "ebike.usableShare",
   "to": "usable-energy.share",
   "props": {
    "ends": {
     "to": {
      "part": "ebike.usable"
     }
    }
   }
  },
  {
   "id": "bind-usable-eco",
   "type": "sysml.BindingConnector",
   "from": "usable-energy.usable",
   "to": "range-equation.energy",
   "props": {
    "ends": {
     "from": {
      "part": "ebike.usable"
     },
     "to": {
      "part": "ebike.eco"
     }
    }
   }
  },
  {
   "id": "bind-usable-boost",
   "type": "sysml.BindingConnector",
   "from": "usable-energy.usable",
   "to": "range-equation.energy",
   "props": {
    "ends": {
     "from": {
      "part": "ebike.usable"
     },
     "to": {
      "part": "ebike.boost"
     }
    }
   }
  },
  {
   "id": "bind-eco-consumption",
   "type": "sysml.BindingConnector",
   "from": "ebike.ecoConsumption",
   "to": "range-equation.consumption",
   "props": {
    "ends": {
     "to": {
      "part": "ebike.eco"
     }
    }
   }
  },
  {
   "id": "bind-boost-consumption",
   "type": "sysml.BindingConnector",
   "from": "ebike.boostConsumption",
   "to": "range-equation.consumption",
   "props": {
    "ends": {
     "to": {
      "part": "ebike.boost"
     }
    }
   }
  },
  {
   "id": "bind-eco-range",
   "type": "sysml.BindingConnector",
   "from": "ebike.ecoRange",
   "to": "range-equation.range",
   "props": {
    "ends": {
     "to": {
      "part": "ebike.eco"
     }
    }
   }
  },
  {
   "id": "bind-boost-range",
   "type": "sysml.BindingConnector",
   "from": "ebike.boostRange",
   "to": "range-equation.range",
   "props": {
    "ends": {
     "to": {
      "part": "ebike.boost"
     }
    }
   }
  },
  {
   "id": "t-capacity",
   "type": "sysml.BindingConnector",
   "from": "trip-range.capacity",
   "to": "usable-energy.capacity",
   "props": {
    "ends": {
     "to": {
      "part": "trip-range.usable"
     }
    }
   }
  },
  {
   "id": "t-share",
   "type": "sysml.BindingConnector",
   "from": "trip-range.share",
   "to": "usable-energy.share",
   "props": {
    "ends": {
     "to": {
      "part": "trip-range.usable"
     }
    }
   }
  },
  {
   "id": "t-usable",
   "type": "sysml.BindingConnector",
   "from": "usable-energy.usable",
   "to": "range-equation.energy",
   "props": {
    "ends": {
     "from": {
      "part": "trip-range.usable"
     },
     "to": {
      "part": "trip-range.trip"
     }
    }
   }
  },
  {
   "id": "t-consumption",
   "type": "sysml.BindingConnector",
   "from": "trip-range.consumption",
   "to": "range-equation.consumption",
   "props": {
    "ends": {
     "to": {
      "part": "trip-range.trip"
     }
    }
   }
  },
  {
   "id": "t-range",
   "type": "sysml.BindingConnector",
   "from": "trip-range.range",
   "to": "range-equation.range",
   "props": {
    "ends": {
     "to": {
      "part": "trip-range.trip"
     }
    }
   }
  }
 ],
 "views": [
  {
   "id": "range",
   "diagram": "sysml.parametric",
   "title": "The e-bike's range in eco and boost",
   "parent": null,
   "subject": "ebike",
   "nodeIds": [
    "ebike"
   ]
  },
  {
   "id": "range-down",
   "diagram": "sysml.parametric",
   "title": "The same analysis, laid out down",
   "parent": "range",
   "direction": "down",
   "subject": "ebike",
   "nodeIds": [
    "ebike"
   ]
  },
  {
   "id": "trip-frame",
   "diagram": "sysml.parametric",
   "title": "TripRange, a constraint block as the frame",
   "parent": "range",
   "subject": "trip-range",
   "nodeIds": [
    "trip-range"
   ]
  }
 ]
}