Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download/Upload initial values and parameters for each step by using shiny modules #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

SaJaToGu
Copy link

Dear Marchena,

I forked and added shiny modules to download/upload initial values and to be able to change parameetrs for each production/replenishment step.

Please have a look.

Thx,

Guido

- use shiny modules
- for each step (Factory, Distributor, Wholesaler, Retailer) now possible:
  + download/upload of initial values
  + setting parameters
app.R to use new shiny modules
app.R instead
app.R and modules in bullwhipgame package instead
@msmarchena
Copy link
Owner

Dear Guido,

Thanks for your interest and contribution to the bullwhipgame project. I have tried to run the new version but I have some problems. It seems that the modules are not found

runApp()
Error in uiModDesc("Description") : could not find function "uiModDesc"
I don't know what is wrong, all the files are in my wd. Do you have any idea why it doesn't work?

@SaJaToGu
Copy link
Author

Hi Marlene,
I will add the RStudio project file tomorrow.
Then you can rebuild the package bullwhipgame with all files I the R directory.
That should solve the unknown modules.

Guido

RStudio project file to build the bullwhipgame package
@SaJaToGu
Copy link
Author

Hi Marlena,

I added the RStudio project file to the fork.
I hope you are using RStudio too and are able to build the package to solve the undefined relations to the modules.
Please let me know.

Thx,

Guido

@msmarchena
Copy link
Owner

The Rstudio project file does not work. I have made the update of all package and Rstudio and still does not work.

shiny::runApp('inst')
Loading required package: shiny
-- Attaching packages --------------------------------------- tidyverse 1.2.1 --
v ggplot2 2.2.1 v purrr 0.2.4
v tibble 1.4.2 v dplyr 0.7.4
v tidyr 0.8.0 v stringr 1.2.0
v readr 1.1.1 v forcats 0.2.0
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
Error in uiModDesc("Description") : could not find function "uiModDesc"
Do you have any idea how I can build the new version? Is it possible that you can send me a zip file by email?

initVal in /data
renamed newbullwhipgame back to bullwhipgame
@SaJaToGu
Copy link
Author

I missed the data path and updated three files.
You have to build the package!
RStudio->Build->Clean and Rebuild
before you have to install this packages if not already done:
shiny,
DT,
plotly,
tidyverse,
graphics,
stats,
utils,
openxlsx

@SaJaToGu
Copy link
Author

I check @home and it worked by open the project in RStudio as a new project from git with project URL
https://github.com/SaJaToGu/bullwhipgame
please try

@msmarchena
Copy link
Owner

Hi Guido,
Using your github and rebuilding worked. Now I need some time to understand what you did. Is there any kind of restriction to upload the file? I have tried to upload 52 weeks of a product and it does not worked. Anyway I will test it tomorrow but it looks fantastic.

@SaJaToGu
Copy link
Author

You should run the app in a browser not in RStudio view. Thant is one restriction of the download/upload functionality.
And I found a bug in the reactive event on upload I will try to solve tomorrow!
Let’s keep in contact😉

@SaJaToGu
Copy link
Author

SaJaToGu commented Feb 1, 2018

Hi Marlene,
I found the bug please retry!
Guido

@msmarchena
Copy link
Owner

Hi Guido,
I've just copy again the library and rebuild it. I'm working in the browser and still can't upload a file with a column with 15 observation (only one sheet). I am working with open office and my file is actually xls, What about to try to put the possibility to chose and csv file? I don't know maybe using a csv file would be better.

@SaJaToGu
Copy link
Author

SaJaToGu commented Feb 1, 2018

Ok, I will try to go for a csv file.
By the way, it's necessary that all steps have the same number of periods.
How can we achieve that?

@msmarchena
Copy link
Owner

Every player is trying to forecast its own demand (the orders of the downstream participant). Actually there are 5 participants, the customer demand is the most important because the game start with these initial values. I need to understand your code to change it later. For instance, I will put just one upload file for the customer demand in the left side panel. In my example I've just put 5 values but maybe I have 1 year of data, with more data the retailer forecast will be more accurate. But the wholesaler can't see the customer demand, he can see only retailer's orders ( wholesaler's demand). The wholesaler could have historical data of the retailer but this demand (retailer's orders) is linked with customer demand. Every participant try indirectly to forecast the customer demand, I think it will be difficult to upload 5 files. For this kind of situation we have the bullwhip effect.
I think that only one upload for the customer demand is enough for the game. Maybe later each participant could start the game with an initial net stock. And answering your question yes. They need to made a decision every period, each time that the customer upload new demand.

@msmarchena
Copy link
Owner

Guido,
Could you please can send me an email? My email is in the About tab in the app. I would like to send you an old app where I have put an upload file into a Data tab. The idea was that the user can upload a csv file, manage the data by selecting columns, do some summary statistics and visualize the data. I'm trying to put this tab the new version but it does not recognize the module that I've created :-/

inst/shiny/app.R Outdated
navbarPage(
"newbullwhipgame",
id = "mainNavbarPage",
theme = "flatky.css",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here theme = "flatly.css"

inst/shiny/app.R Outdated
ns <- session$ns

# reactive values
inputs_rv <- reactiveVal()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the role of inputs_rv <- reactiveVal() here and in srvModPlay.R file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants