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

3.4 数理モデルの検証冒頭のコードについて #13

Open
canard0328 opened this issue Oct 31, 2022 · 1 comment
Open

3.4 数理モデルの検証冒頭のコードについて #13

canard0328 opened this issue Oct 31, 2022 · 1 comment

Comments

@canard0328
Copy link

for s in S:
    # 割り当てられたクラスを取得
    assigned_class = [x[s,c].value() for c in C if x[s,c].value()==1]

ですとassigned_classには1しか入らないので、割り当てられたクラスを取得したいのでしたら、

for s in S:
    # 割り当てられたクラスを取得
    assigned_class = [c for c in C if x[s,c].value()==1]

とする必要があるのではないでしょうか?

jiro-iwanaga added a commit that referenced this issue Nov 3, 2022
#13 への対応
@jiro-iwanaga
Copy link
Collaborator

@canard0328
ご連絡いただきありがとうございます。
ご指摘の通りリスト assined_class に割り当てられたクラスが入っておらず、変数名として不適切であることを確認しました。ただし、次のコードでassigned_classの長さ(割り当てられたクラスの数)のチェックをしているだけなので、コードとしては不整合は起きておらず、そのため気づくのが遅れてしまいました。
ご迷惑おかけして申し訳ございません。

ご指摘いただいた修正がより適切ですので、正誤表に反映させていただきました。
第6刷で修正対応するように進めます。

このたびはご連絡いただきありがとうございます。

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

No branches or pull requests

2 participants