2026年1月12日月曜日

今年予定しているUpdate

 1)数理ソルバのUpdate

MaxSATソルバ、Highsソルバに加えて、数理計画ソルバのアップデートを予定しています。基幹アルゴリズム1には、手を加えず、Highsソルバの最新版へのアップデート、および、数理計画ソルバのアップデートを予定しています。6月頃の予定です。予定している世界記録更新は、商用LPソルバCOPTを使用したものであり、リリース版での搭載は予定していません。現在開発版は、COPTを使用しています。アルゴリズム自体は、COPTを使用しなくても動作しますが、リリース版では分離作業が必要になります。数理ソルバは、多くの技術分野の集積によるもので、実インスタンス向けの統合化実装はこれからの作業になります。ベンチマークで動いても、広範囲な実インスタンスに対応するのは、多くの困難が予想されます。究極のソルバであり、ナーススケジューリングにおいて、到達可能な極点、現時代の最終到達点を示すことになる、と思います。あらゆる実務ナーススケジューリングインスタンスにおいて、本当の物理限界、厳密解はどこにあるか?といったらまずスケジュールナースで試してみる、といった立ち位置になることを期待していて、リリース後は、そのための学術プロモーション活動を開始します。

2)AI IF(MCPインタフェース)を追加

MCPサーバは、現在Pythonで書いていて、ソースはGithubで公開します。これは、シフトのみついて、4月頃のリリースを予定しています。実験的リリースです。これも幾多の試みがあるものの、実用域に達しない自然言語によるAIモデリングに対する挑戦と提案です。


まずは、開発者向けの機能を提供したいと思います。実装したいアイデアは、山ほどあります。それをベースに一般の開発者やContributorが、さらに有効な機能や使い方を拡張できるようになると思います。

後になって、2025年というのは、MCPサーバが花開いたエポックメーキングな年だった、と言う風になるのではないでしょうか?

想えば、求解ソルバとAIモデリング、二つの課題に真正面から取り組んできた10年でした。私の自負は、他に誰も取り組んでこなかったテーマに10年間取り組んだことです。10年前に居た研究者は、皆どこかに行ってしまい、Gurobiで解くことが研究になってしまいました。

永く取り組んできた求解ソルバは今年で開発終了とします。AIモデリング化については、今年がスケジュールナースにとっての元年になるかと思われますが、そうではありません。沢山の実務インスタンスの集積(日本語による制約名が強制されている)は、Github上にあります。ユーザが語る自然言語から制約に落としてきた10年の経験と資産があります。これらの集積は、一朝一夕で出来るものではなく、これらの資産なしには、精度の高いAIモデリングは難しいと思います。資産とMCPを結びつけることが、提案骨子となります。いずれにせよ、求解ソルバと違い、AIモデリングの取り組みは、未来永劫、終わることのない戦いを強いられるでしょう。

 

2026年1月11日日曜日

Google AIモードが優秀

 コパイと会話しながら、MCP設計を進めていましたが、平気で嘘を言うのには、閉口します。

試しに、GoogleのAIモードでコード修正の提案を依頼すると、とても良い回答が返ってきました。そこで、Google AIモードで相談しながらMCP API設計を進めることにしました。

コードが動かないときに、AIに相談するのですが、本当らしい、嘘を言うのは、残念ながら、どちらも同じです。なので、真実を突きとめるには、やはり相応の技術を持ち合わせている必要がある、と痛感しました。

これは、ナーススケジューリングのモデリングにおいても同じことが言えると思います。例えば、複数の病棟があったとして、一人の管理者が複数の病棟のケアをするのは、結構労力が要ると思うのですが、AIモデリングについて、特性を熟知していると、その管理者にとって、強力なツールになりえるのでは?と思います。

また、初心者でツールの操作が良く分からない、と言った場面等、学習用途には、相性が良い可能性を感じました。何度同じ事を聞いても怒られることはないし、説明が秀悦で、分かり易いです。

AIにより助けられる場合もありますし、逆に指摘や、変更が間違っていると、間違ったところに労力を消費してしまう、ということがありえる、ということです。この辺、初心者と上級者で、使いどころを間違えないようにする必要がありそうです。

2026年1月9日金曜日

Q 買い切り版を購入した場合、今後アップデートや機能改変があった際には再購入が必要になるのでしょうか。

 Ans.

いいえ。必要ございません。

例えば、何世代か前の初期製品を10年前にご購入頂いたお客さまは、現在も世代・形態を変えながら、追加コストなくお使い頂いています。(ご購入当時は、買い切り版という形態はありませんでした。現在のストアでの販売形態もありませんでした。)


絶対というお約束はできませんが、将来的にもこうしたポリシーは維持したいと考えています。



2026年1月8日木曜日

Jsonスキーマ生成

 Newtosoftから、System.Text.Jsonに移行しました。コパイによれば、

- .NET Framework 4.x で `System.Text.Json` を使う場合 → **必ず NuGet パッケージが必要**

とのことです。

確かに、「参照」で追加した場合、DLLの相互依存が複雑らしくて、トラブルの元になりそうでした。NuGetで追加するのが確実なようです。

Jsonスキーマは、内部で、
JsonNode schema = options.GetJsonSchemaAsNode(typeof(singleA));
var json = JsonSerializer.Serialize(schema, new System.Text.Json.JsonSerializerOptions {
    WriteIndented = true
});

で生成させることが出来ました。

singleAというC#クラスが、スケジュールナース制約全体を表します。下図は、2020年当時の構成図になります。(現在は少しだけUpdateしていますが大まかには、変わりません。)

普段は、これをJsonにシリアライズして、最適化ソルバに渡して、ソルバが解を生成している訳です。で、このスキーマを生成させる仕組みが、上の記述です。

Python MCPでやりたいことは、各構成要素をAPIで、設定できるようにすることです。普段は、GUIで設定しているのですが、MCPサーバでも個々にできるようにする、ということになります。それだけを公開して、あとは、AIに頑張ってもらう、という発想です。

人がGUIで制約を記述するのをAIに肩代わりしてもらう、あるいは、プログラミングで、自動設定する、という目的のためでもあります。以前、予定セルのプログラミング入力を構想していたことがありましたが、その目的も兼ねています。

以下は、生成したJsonスキーマになります。

一言で言えば、Jsonのフォーマットということになるでしょうか。
例えば、最初の”SO”は、シフトオブジェクトのクラスを表しています。その次の”DO”は、Dayオブジェクトと言った具合です。

このオブジェクト群を読み込み、設定、追加、編集できるようにすることが目指しているMCPサーバになります。

生成されるJsonは、大きいと数MBを超えます。となるとAIモデルのトークン数の上限を簡単に超えてしまうことが懸念されます。しかし、その多くは、予定や、コメント、Python記述で、エッセンス部分ではありません。なので、エッセンス部分を残してハンドリングするようにすれば、なんとかなるのでは?と思っています。

{
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "SO": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "auto_schedule": {
                "type": "boolean"
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "another_labels": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "another_colors": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "num_cnt": {
                "type": "integer"
              },
              "work_start_time": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "work_hours": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    "DO": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "days": {
          "type": "integer"
        },
        "target_year": {
          "type": "integer"
        },
        "target_month": {
          "type": "integer"
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "val": {
                "type": "integer"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "dates": {
                "type": [
                  "array",
                  "null"
                ]
              },
              "use": {
                "type": "boolean"
              },
              "predefined": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "DA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "Operator": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "dates": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "use": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "SA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "Operator": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "PA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "shift_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "list": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "type": {
                      "type": "integer"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "time_string": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "color": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "day": {
                      "type": "integer"
                    },
                    "phase_no": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "primary_labels": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "alias_labels": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "dayphase_list": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/properties/PA/properties/members/items/properties/list/items"
          }
        }
      }
    },
    "TAA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "Operator": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "TO": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "auto_schedule": {
                "type": "boolean"
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "shift_ag_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "another_labels": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "another_colors": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "work_hours": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    "PO": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "auto_schedule": {
                "type": "boolean"
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "num_cnt": {
                "type": "integer"
              },
              "work_hours": {
                "type": "integer"
              },
              "tasks": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "POA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phase_object_names": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "GP": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "GA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "Operator": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "SP": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "shifts": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "tasks": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "properties": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "CC": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "phase_mode": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "use": {
                "type": "boolean"
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "def_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "use": {
                      "type": "boolean"
                    },
                    "shift_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "shift_at_phase": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "task_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "primary_day_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "staff_property_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "constraint_type": {
                      "type": "integer"
                    },
                    "min_double": {
                      "type": "number"
                    },
                    "max_double": {
                      "type": "number"
                    },
                    "dayphase_vec_max": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dayphase_vec_min": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "max_value": {
                      "type": "integer"
                    },
                    "min_value": {
                      "type": "integer"
                    },
                    "soft_constraint_level": {
                      "type": "integer"
                    },
                    "soft_constraint_level_max": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "RC": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "phase_mode": {
                "type": "boolean"
              },
              "equal_count_mode": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "use": {
                "type": "boolean"
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "intercept": {
                      "type": "integer"
                    },
                    "phase_mode": {
                      "type": "boolean"
                    },
                    "equal_count_mode": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "def_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "use": {
                      "type": "boolean"
                    },
                    "primary_day_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "first_day_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "last_day_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "staff_property_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pattern": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "shift": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "level": {
                            "type": "integer"
                          },
                          "a_ix": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "shift_pattern": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "$ref": "#/properties/RC/properties/members/items/properties/members/items/properties/pattern/items"
                      }
                    },
                    "inv_pattern": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "boolean"
                      }
                    },
                    "shift_inv_pattern": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "boolean"
                      }
                    },
                    "A_daytypes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "B_daytypes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "constraint_type": {
                      "type": "integer"
                    },
                    "max_value": {
                      "type": "integer"
                    },
                    "min_double": {
                      "type": "number"
                    },
                    "max_double": {
                      "type": "number"
                    },
                    "min_value": {
                      "type": "integer"
                    },
                    "min_staff_property": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "max_staff_property": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "soft_constraint_level": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "SolP": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "solving_map": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "object",
              "properties": {
                "use": {
                  "type": "boolean"
                },
                "value": {
                  "type": "integer"
                },
                "total_max_errors": {
                  "type": "integer"
                },
                "weight": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "external_constraint": {
          "type": [
            "string",
            "null"
          ]
        },
        "external_constraint_python": {
          "type": [
            "string",
            "null"
          ]
        },
        "python_property_file": {
          "type": [
            "string",
            "null"
          ]
        },
        "python_property_file_post": {
          "type": [
            "string",
            "null"
          ]
        },
        "comment": {
          "type": [
            "string",
            "null"
          ]
        },
        "parameters": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "integer"
          }
        },
        "aws_parameters": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "Sch": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/properties/RC/properties/members/items/properties/members/items/properties/pattern/items"
            }
          }
        }
      }
    },
    "TSch": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/properties/Sch/properties/members/items"
          }
        },
        "days_property1": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "Dic": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "first": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "second": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              },
              "task_name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "PIC": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "equal_count_mode": {
                "type": "boolean"
              },
              "phase_mode": {
                "type": "boolean"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "use": {
                "type": "boolean"
              },
              "members": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "equal_count_mode": {
                      "type": "boolean"
                    },
                    "numerical_offset": {
                      "type": "integer"
                    },
                    "numerical_offset_string": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phase_mode": {
                      "type": "boolean"
                    },
                    "phase_str": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "def_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "use": {
                      "type": "boolean"
                    },
                    "shift_typeA": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "shift_typeB": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "shift_typeA_at_phase": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "shift_typeB_at_phase": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "day_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "staff_property_typeA": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "staff_property_typeB": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "operatorA": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "operatorB": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dayoffset": {
                      "type": "integer"
                    },
                    "constraint_type": {
                      "type": "integer"
                    },
                    "soft_constraint_level": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "MA": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "fg": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "excel_file": {
              "type": [
                "string",
                "null"
              ]
            },
            "sheet_name": {
              "type": [
                "string",
                "null"
              ]
            },
            "enable_excel": {
              "type": "boolean"
            },
            "excel_output_enable": {
              "type": "boolean"
            }
          }
        },
        "guide_pdf_path": {
          "type": [
            "string",
            "null"
          ]
        },
        "html_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "members": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "use": {
                "type": "boolean"
              },
              "apply_ex": {
                "type": "boolean"
              },
              "comment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "expressions": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "daytype": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "grouptype": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "def_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "integer"
              },
              "value": {
                "type": "integer"
              },
              "ex_value": {
                "type": "integer"
              },
              "value_double": {
                "type": "number"
              },
              "ex_value_double": {
                "type": "number"
              }
            }
          }
        }
      }
    },
    "major_version": {
      "type": "integer"
    },
    "sub_version": {
      "type": "integer"
    },
    "solver_version": {
      "type": "integer"
    },
    "user_class": {
      "type": [
        "string",
        "null"
      ]
    },
    "user_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "eval_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "ProjectName": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}

2026年1月7日水曜日

Q.月額480円のサブスクリプションプランに加入した場合、サポートはどこまで含ま れるのでしょうか。

 Ans. 

サブスクのお客さまについては、メールのみです。電話はZOOM対応はございません。ご質問はプロジェクトファイルを添付して頂いて、

それについて、ここをこうしたい、といったご質問をお受けします。基本的には、プロジェクト変更の仕方についてのアドバイスとなります。変更そのものを請け負うということではありません。回答は、他のお客さまの参考にもなるように、ブログで行う場合が多いです。


例)

https://schedule-nurse.blogspot.com/2025/12/q.html

2026年1月6日火曜日

MCPのアーキテクチャ

 コパイと相談しながらアークテクチャを確定させました。

当初、C#⇒Pythonnetを使う構想だったのですが、ストアアプリでは、プロセス起動が制限されPythonの起動は許されないとの指摘を受け、以下のように変更しました。

  • Python(FastMCP)が NamedPipe 経由で WinForms に API を発行
  • WinForms は Python の要求に応じて UI を操作
  • 双方向ストリーミング
  • ストアアプリ制限ゼロ
  • MCP と UI がリアルタイム連携

AIモデルは、Claude Desktopを想定しますが、それに限定しません。その時代の先端モデルを使ってもよいし、セキュリティの関係上ローカルLLMを使っても良いです。

<GUIで制約を可視化>
このアーキテクチャは、下記のようなモデリングに対するフィードバックを備えていません。

MCP TOOLは、スケジュールナース上の制約オブジェクト群に対する操作であり、一つ一つの制約は、GUIで可視化されます。ユーザは、それを見ながら、指示を出して行けばよい、という構想です。大雑把な設定は、AIモデリング、細かなチューニングは、従来通りGUIベースという発想です。

<AIで指示しなくともよい>
もう一つの特徴は、基本的にスケジュールナースの制約オブジェクトに関する操作そのものなので、必ずしもAIが指示する必要はない、ということです。プログラミング言語による操作でもよく、Python記述の指示を人が記述しても良いです。


■AIモデリングは、大雑把な枠組みの記述することが出来ます。
■あるいは、シフトスケジューリングサーバとして、AIとは別に動作させることも出来ます。
(従来は、ソルバIFをユーザIFとしてしましたが、今回はGUIを含んでいるところが違います)
■あるいは、ストアアプリであるスケジュールナースをAIと会話しながらモデリングをする楽しさを味わうことも出来ます。

これから、APIを設計して行きますが、基本的には、現状、備えている

制約⇔GUI

処理系をそのままJSONスキーマに落としていくだけの機械的な作業です。

新しい部分は、

■Python記述生成
Python記述(DSL(Domain Specific Language)によるGUIでは対応不可能な部分の記述)を自動生成する部分ですが、これは未だ構想の域を出ません。

■予定編集
例えば「AさんのX月Y日から3日間休みにして」と言うと(Claude AIはテキストベースなので、これは出来ませんが)予定を追加するツールになります。

■概略モデル生成
LPソルバベースでの概略モデルを生成します。現在のスケジュールナースは、最初からFINEモデルを要求しているきらいがありますが、とりあえずの概算モデルを高速に生成します。これは、COARSEモデルです。

現在JSONのシリアライズは、Newtonsoftを用いていますが、JSONスキーマを生成するには、有償版を使う必要があります。そこにコストはかけたくないので、JSON生成を別なものに置き換えることにしました。

そのための作業を開始しています。

<ユーザ側で用意するのは>
■生成AIモデル
無償・有償(サブスク)どちらもアリです。

■Python処理系
Python3以上であれば、バージョンを問いません。無償です。

つまり、生成AIモデリングを愉しむのに余計なコストはかかりません。PythonMCPソースもスケジュールナースが生成するので、すぐに始められようになる筈です。

「完璧」は期待すべくもありません。しかし、AIモデリングの一つの実施形態として問いてみたい、一言で言えば、愉しみたい、そんな想いです。


2026年1月2日金曜日

最適化プロジェクトを提供する側

の論理とユーザさまとの間にバリアは、存在します。良記事だと思います。 

最適化プロジェクトを『ラク』にするプラクティス #Python - Qiita

ナーススケジューリングの場合、さらに重要なのは、最適化周辺の知識です。使いこなしや、OR周辺知識といった類についてのレクチャは、必要です。

加えて、私が重視しているのは、人力解との差から出発することです。最適化ソルバは、重視する制約違反数が、人力に比べれば圧倒的に少ないです。まずは、この性能差を認識して頂くことが出発点です。いきなり最適化ソルバの解を見せることはしません。重要な制約項目に関して、制約違反数という、数値比較をきっちり行うことが出発点になります。全ての制約を満たすことは物理的に無理なことを体感して頂きます。何を満たして、何を満たさなくてよいのか、決定できるのは、ユーザさまだけです。それを、意識して頂く為に、人力解との差から出発します。徒手選択をユーザ自身が行えるようにするには、そうした状況に向き合うことが始まりです。

いわば、曖昧、不確か、混沌とした言語化していない脳内世界から、言語化した制約化、違反数比較、目的関数値比較という客観的世界への変態・シフトチェンジ、ユーザさまご自身で考え方を身に着けて頂くことが、そのエッセンスです。


何で躓いているかは、ユーザさまのレベルの違いもあり様々です。個々のユーザに寄り添い、一つ一つ問題を一緒に解くことが、最良のアプローチです。

残念ながら、このサービスを提供できるのは、現在のところ私しかいないのですが、私の分身を作るべく今年は、この分野の門を開け、開発作業を開始したい、と思います。