1. 21 Dec, 2018 1 commit
  2. 14 Dec, 2018 5 commits
    • Anne Hommelberg's avatar
      Add unit tests for new io classes · eb5e4b7f
      Anne Hommelberg authored
      Adds unit tests for the two IOMixin and DataStore classes.
      Also fixes some minor bugs in the set_timeseries method.
      Also adds the get_parameter_ensemble_size method to make parameter
      access in the DataStore consistent with access to the stored time
      series.
      eb5e4b7f
    • Anne Hommelberg's avatar
      Fix duplicate checks in DataStore · bc0b8320
      Anne Hommelberg authored
      To keep backwards compatibility with the old duplicate parameters
      check in PIMixin, the DataStore should overwrite the old values with
      new values when duplicates occur. If check_duplicates is True, a
      warning will be given each time this happens.
      bc0b8320
    • Anne Hommelberg's avatar
      Add io accessor for all DataStore access · 8f743998
      Anne Hommelberg authored
      To avoid method naming conflicts, all access methods for
      the internal data store have been put into an self.io accessor.
      For example, call self.io.get_times to get the times stored in the
      internal data store.
      8f743998
    • Anne Hommelberg's avatar
      Fix unit tests · f2aae576
      Anne Hommelberg authored
      The DataStore should allow the input and output folder to not be
      specified, in case the user chooses to not use any of the provided
      IOMixins.
      f2aae576
    • Anne Hommelberg's avatar
      Add general DataStore and IOMixin classes · 00c7de3f
      Anne Hommelberg authored
      Large refactoring of all IO mixins (PIMixin and CSVMixin).
      Adds a general DataStore class extended by OptimizationProblem
      and SimulationProblem, which is used to store all data read by
      the IO mixins.
      Adds an optimization IOMixin class which contains methods that
      were previously duplicated in the optimization PIMixin and
      CSVMixin.
      Adds a simulation IOMixin class which does the same for the
      simulation PIMixin and IOMixin.
      00c7de3f
  3. 13 Dec, 2018 2 commits
  4. 12 Dec, 2018 1 commit
  5. 11 Dec, 2018 2 commits
  6. 07 Dec, 2018 1 commit
    • Tjerk Vreeken's avatar
      Optimize evaluation of delay duration · 0ab02ffa
      Tjerk Vreeken authored
      Creating a ca.Function for every single delay is costly. We can save a lot
      of time by combining the evaluation of all delay durations in one
      function.
      
      Note that large parts of this commit's diff are just re-indented or
      moved code.
      0ab02ffa
  7. 06 Dec, 2018 1 commit
    • Jorn Baayen's avatar
      Allow extra variables to appear in path expressions. · 1c0f5f9d
      Jorn Baayen authored
      This is useful for the following type of situation.  Imagine wanting
      to put a uniform upper bound for a state over all time steps.  Then,
      this bound would be an extra variable, and the bound constraint would
      be imposed as a path constraint.
      1c0f5f9d
  8. 26 Nov, 2018 2 commits
  9. 22 Nov, 2018 2 commits
  10. 21 Nov, 2018 2 commits
    • Jesse VanderWees's avatar
      Improve CSVLookupTableMixin and LookupTable tests · e752e0b2
      Jesse VanderWees authored
      Testing of lookuptables was sloppy and not very thorough. Furthermore,
      the tests treated CSVLookupTableMixin as though it is an extension of
      CSVMixin, while the reality is that it is completely independant. This
      commit splits the testing of CSVLookupTableMixin and the LookupTable
      class into its own file, and tests both the symbolic and numerical
      evaluation of LookupTable functions.
      e752e0b2
    • Jesse VanderWees's avatar
      Properly handle LookupTable __call__() parameters · ec12c16c
      Jesse VanderWees authored
      The handling of LookupTable __call__() parameters was somewhat sloppy,
      without clear error codes if parameters were not supported. Furthermore,
      calling with np.nan would expose undefined behaviour. This commit
      improves error messages and does explicit handling of np.nan parameters.
      ec12c16c
  11. 20 Nov, 2018 7 commits
  12. 19 Nov, 2018 4 commits
  13. 18 Nov, 2018 1 commit
    • Jorn Baayen's avatar
      Update/fix cascading channels example · 1cbda0a6
      Jorn Baayen authored
      1. Use semi-implicit discretization
      2. Add a steady-state initialization
      
      The steady-state initialization is required to prevent spurious waves from
      occurring at the start of the optimization run. The example documentation
      has been amended to stress the importance of setting correct values for
      the initial derivatives (typically _not_ steady state in an operational
      setting).
      1cbda0a6
  14. 16 Nov, 2018 2 commits
    • Jesse VanderWees's avatar
      Refactor doc plotting scripts · 7fbe6619
      Jesse VanderWees authored
      These scripts were hard to read and not really scaling the results well.
      This commit makes sure that code is legible, as many of the examples
      render the plotting scripts inline. We also add the plotting scripts to
      the flake8 tests, to enforce good formatting going forward.
      
      We also now use the plotting script for the basic example and have
      gotten rid of that ugly excel .png snip that was used before.
      7fbe6619
    • Jesse VanderWees's avatar
      Render plots as transparent svg · 938e58cb
      Jesse VanderWees authored
      This gets rid of the hazy look to the plots in the documentation, and
      also allows the (slightly) off-white background from the sphinx rtd
      theme to come through instead of that unsightly wight box.
      938e58cb
  15. 13 Nov, 2018 1 commit
    • Jesse VanderWees's avatar
      Sim: Update eliminable variable expression · fe6b845d
      Jesse VanderWees authored
      Since Pymoca 0.4.1, expanding vectors is performed first if expand_mx is
      set as well. This means that the variable elimination should also handle
      trailing array indices, e.g. "a.b._c[1,2]" instead of just "a.b._c".
      
      This commit mirrors commit 854d9605, where optimization was fixed.
      fe6b845d
  16. 06 Nov, 2018 2 commits
    • Teresa Piovesan's avatar
      Add alternative goal programming hard constraints · f6eb00d9
      Teresa Piovesan authored
      A new way of turning the soft constraints of goals into hard constraints
      is added in this commit. The user can choose to use this alternative by
      setting setting 'keep_soft_constraints' to True.
      
      The new implementation keeps the soft constraints and the violation
      (a.k.a. epsilon) variables around, and just constrains the objective
      value that a certain priority evaluated to. Note that the results are
      expected to be the same if all violations will be 0.0. Only when
      violations become nonzero can the new implementation provide more room in
      further priorities.
      
      The new implementation is expected to help with infeasibilities in lower
      priorities, even if a trivial goal is added. It turned out that the
      current/old way of goal programming could lead to these infeasibilities,
      likely because it generated entirely differently looking hard constraints.
      
      Note that keeping the violation variables around may or may not lead to a
      performance hit. Because the constraints of the problem remain entirely
      the same except for one additional constraint (and the constraints of the new
      priority), the solver may more readily pick up the seed solution and
      actually be faster in solving the new priority.
      
      A word of caution when using this option with (MI)QCP solvers. A
      quadratic objective will turn into a quadratic constraint. In other words,
      a MIQP problem can turn into a MIQCPQP problem (if the next priority also
      has a quadratic objective). This is something that solvers like Gurobi and
      CPLEX typically cannot handle.
      
      Closes #1048
      f6eb00d9
    • Tjerk Vreeken's avatar
      Fix indexing error in goal function value storage · 41488125
      Tjerk Vreeken authored
      For normal goals, if we would have more than one goal_function stored,
      the indexing would fail because the indices were reversed. The results
      would be a column vector, meaning we would have to index with `[j, :]`
      instead of `[:, j]`. We transpose it into a row vector, such that we can
      use the same indexing for path goals as for normal goals.
      
      The missing broadcasting of goal function values for normal (i.e. not
      path) goals is a regression introduced in 3690cfa4. Instead of relying
      on np.full_like() to do broadcasting, We now explicitly make a
      Timeseries object, which will do the broadcasting for us if needed.
      41488125
  17. 05 Nov, 2018 2 commits
  18. 03 Nov, 2018 2 commits