Giter VIP home page Giter VIP logo

mdpsolver's Introduction

Bonjour / Hoi / Hi there! ๐Ÿ‘‹

I'm a data enthusiast who loves both the science and engineering side of data. Concrete things I like doing:

  1. Organising and orchestrating the inflow of data to an easy-to-explore data warehouse.
  2. Learning to write simple and beautiful software using best practices in different programming paradigms: OOP, functional, imperative.
  3. Exploring and leveraging patterns in all sorts of data (images, text, tabular) using all sorts of models (statistical and ML).
  4. Connecting explorative and predictive analysis with prescriptive analysis using Operations Research techniques.

mdpsolver's People

Contributors

markkvdb avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

mdpsolver's Issues

Policy evaluator

The policy evaluator should take a vector of size SxS, where an element indicates the action in that particular state, i.e., it should define a (mainAction1, mainAction2, prodRate1, prodRate2) tuple for every element.

We then simulate the MDP over a time horizon and take the average cost.

Create skeleton of the Init class.

The Init class should contain all the data that will be used in the problem. A (subset) of all data is given below:

  • d_L: maximum deterioration level.
  • d_cpm: Cost of preventive maintenance.
  • d_ccm: Cost of corrective maintenance.
  • d_C: Fixed cost of doing maintenance.
  • d_pi: Total production rate of the system.
  • d_gamma_mean: Mean of the gamma process.
  • d_gamma_std: Standard deviation of the gamma process.
  • More...

Sensible starting values for valueA

Setting the starting values of d_valueA in the MDP class to zero results in a nonsensical solution. The value iteration will only see expected values of 0, hence not doing maintenance results in the optimal solution (no direct cost incurred).

Create p(u, 1)

This function gives the probability of jumping (0, 1, 2, ...) deterioration levels. Note that this is independent of the current deterioration level.

Create skeleton MDP class

Specify the skeleton of the MDP class.

Data members:

  • ...

Public functions:

  • solve()

Private functions:

  • exp_cost() #1
  • expected_cost(x1, x2) #2
  • expected_costs(x1, x2, u1, u2) #3
  • converged() #4

Not fully specified MDP

When the machine is in the failed state it should not be able to set a production rate.

Question: How do we prevent a state of the system, where we cannot meet demand restrictions due to failed units?

Create converged()

Create a function that will tell whether the value iteration algorithm has converged. This is simply checked by looking at the span.

Add heuristic that only considers subset of jumps.

Write new versions of exp_cost, expected_cost, expected_costs that support this maximum. Note that we should select min(d_nStates - state -1, maxJump).

Then the solve function should consist of two do loops.

Swap instead of copy vector

In the function void MDP::solve() we copy the whole vector d_valueA = d_valueB. However, we do not need d_valueB anymore after this call so we may swap the vectors. This might help when the state space gets really large.

I can also image that is doesn't help. So postpone this issue such that we can test later on.

MDP::feasible_production

Are we sure that we need & instead of &&?
I personally prefer to use and instead of &&.
The same holds for or instead of ||

Furthermore, you can just return the comparison instead of using an if-statement.

Create hash(x1, x2)

Since going linear through memory in C++ is faster than to create a matrix, we create a hash function that maps a given input (x1, x2) to a 2d vector.

create exp_cost()

The exp_cost should return a vector with the values corresponding to the new iteration.

Create p(u,2)

Similar to p(u,1) this gives the probability of having a failure starting from states 0, 1, ..., L.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.