# HG changeset patch # User uncorrelated zombie # Date 1666822887 -32400 # Node ID d52c39e8228a62f46f6a45c518904aee6234d8e5 # Parent f7bf25ad338e6093edbf699e7ded75ee55f740d5 経済のコアのオン/オフを追加 diff -r f7bf25ad338e -r d52c39e8228a EdgeworthBox.R --- a/EdgeworthBox.R Thu Oct 27 07:09:58 2022 +0900 +++ b/EdgeworthBox.R Thu Oct 27 07:21:27 2022 +0900 @@ -1,4 +1,4 @@ -drawEdgeworthBox <- function(init_A=0.9, init_B=0.3, CC=TRUE, SHP=TRUE, I=TRUE, E=TRUE){ +drawEdgeworthBox <- function(init_A=0.9, init_B=0.3, CC=TRUE, SHP=TRUE, I=TRUE, E=TRUE, CORE=TRUE){ # 経済の財は合計1に固定し、かつそれぞれの配分の最小値を0.01とする modifyParam <- function(g){ g <- max(0.01, g) @@ -212,7 +212,7 @@ } # 初期点を通る無差別曲線を描画 - if(I) drawIDC(initial_goods, names=c(expression(U[1]^I), expression(U[2]^I)), IsCore=TRUE) + if(I) drawIDC(initial_goods, names=c(expression(U[1]^I), expression(U[2]^I)), IsCore=CORE) with(equilibrium, { # 均衡を通る無差別曲線を描画 diff -r f7bf25ad338e -r d52c39e8228a app.R --- a/app.R Thu Oct 27 07:09:58 2022 +0900 +++ b/app.R Thu Oct 27 07:21:27 2022 +0900 @@ -19,10 +19,11 @@ min = 0.01, max = 0.99, value = 0.3), - checkboxInput("isCC", "Contract Curve", TRUE), + checkboxInput("isI", "Initial Point", TRUE), + checkboxInput("isE", "Equilibrium", TRUE), checkboxInput("isSHP", "Separating Hyperplane", TRUE), - checkboxInput("isI", "Initial Point", TRUE), - checkboxInput("isE", "Equilibrium", TRUE) + checkboxInput("isCore", "Core", TRUE), + checkboxInput("isCC", "Contract Curve", TRUE) ), mainPanel( @@ -33,7 +34,7 @@ server <- function(input, output) { output$distPlot <- renderPlot({ - drawEdgeworthBox(input$A, input$B, CC=input$isCC, SHP=input$isSHP, I=input$isI, E=input$isE) + drawEdgeworthBox(input$A, input$B, CC=input$isCC, SHP=input$isSHP, I=input$isI, E=input$isE, CORE=input$isCore) }, width=400, height=400) }