# SCMOPT Project


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

SCMOPTを基礎としたWebアプリケーションは， https://www.logopt.com/demo/
で無料トライアルすることができます．

SCMOPTを用いたケーススタディは[講義ビデオ](https://youtu.be/vqXadn-gt2s)
で視聴できます．

## Project Outline

- コア core （基本モジュール） + グラフクラスモジュール
  scmgraph/SCMGraph
- データ生成モジュール data_generation
- ABC分析とランク分析モジュール abc とSCM基本分析システム
- 配送計画モジュール vrp と配送最適化システム METRO (MEta Truck Routing
  Optimizer)
- 在庫最適化モジュール inv と安全在庫配置システム MESSA (MEta Safety
  Stock Allocation system)
- ロジスティックネットワーク設計モジュール lnd
  とロジスティックネットワーク設計システム MELOS (MEta Logistic
  Optimization System)
- 需要予測モジュール forecast と需要予測システム ABD-Forecast
  (Auto-Bayes-Deep Forecast)
- スケジューリング最適化モジュール optseq
  とスケジューリング最適化システム OptSeq
- サプライ・チェイン・リスク分析モジュール scrm
  とサプライ・チェイン・リスク分析システム MERIODAS　(MEta RIsk Oriented
  Disruption Analysis System)
- シフト最適化モジュール shift とシフト最適化システム OptShift
- ロットサイズ最適化モジュール lotsize とロットサイズ最適化システム
  OptLot
- サービスネットワーク設計モジュール snd
  とサービスネットワーク設計最適化システム SENDO (SErvice Network Design
  Optimizer)
- 収益管理モジュール rm
- 制約最適化モジュール scop
- 数理最適化モジュール mypulp
- サプライチェイン最適化ケーススタディモジュール case
- REST APIモジュール rest

## SCMOPT全体像

![](index_files/figure-commonmark/cell-4-output-1.jpeg)

## サプライ・チェイン意思決定のフロー

![](index_files/figure-commonmark/cell-5-output-1.jpeg)

## 実装方法

![](index_files/figure-commonmark/cell-6-output-1.jpeg)

## Install for Developers

Install on Mac or linux (some packages do not work on windows)  

1.  git clone `https://Your-User-Name@github.com/scmopt/manual.git`

2.  Move to the directory “manual”

3.  poetry install

4.  poetry shell

5.  jupuyter lab

### When poetry is slow, try

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w
net.ipv6.conf.default.disable_ipv6=1

### Git Connection

1.  First time only:     - nbdev_install_git_hooks     - git remote add
    origin `https://Your-User-Name@github.com/scmopt/manual.git`

2.  Everytime you want to push (in the top directory)     -
    nbdev_build_lib     - nbdev_build_docs     - git add .     - git
    commit -m “Comment”     - git push (origin master: option)

3.  If you have some “git connection” errors, try:

    - nbdev_clean_nbs
    - nbdev_install_git_hooks

### How to use nbdev

See `https://nbdev.fast.ai/`

## Deployment

### DEMO optimization systems: deployed in Digital Ocean

https://demo.logopt.com/scm/ without OSRM

Remark: fastai, fbprophet (using miniconda) need to be installed locally
(now “poetry add” works locally; not tested on linux)

See “Dockerfile-all.txt”

Docker images: scmopt, osrm need to be composed.

In OSRM: need to run “./osrm-routed –max-table-size=10000
japan-latest.osrm”

In scmopt: need to run “streamlit run app.py” in scripts directory.

------------------------------------------------------------------------

## To do:

### Web app + Excel interface for End Users

- OptShift: shift for staff and manager
- METRO: vehicle routing optimizer (need OSRM)
- OptLot: need a solver; too slow for large instances  
- OptSeq:
- MELOS: logistics network design; too slow for large instances
- …

### Use firebase and deploy to GCP

- authentification
- (realtime) database
- security

\#hide \## How to use streamlit

Streamlit scripts are in /scripts/

https://docs.streamlit.io/index.html

1.  Use an editor (such as vscode) to write a python script.
2.  Move the folder and “streamlit run filename.py”

\#hide \## Jupyterlab Extensions

> brew install node

In Jupyterlab:

1.  Go into advanced settings editor.
2.  Open the Extension Manager section.
3.  Add the entry “enabled”: true.
4.  Save the settings.
5.  If prompted whether you are sure, read the warning, and click
    “Enable” if you are still sure.

Then install extension from a menu in sidebar.

\#hide \### Translate text message in streamlit app
