[Python] CP-SAT | OR-Tools: Get existing variable by name?

Discussão em 'Python' iniciado por Stack, Setembro 24, 2024.

  1. Stack

    Stack Membro Participativo

    Is it possible to get an existing variable by its name? Something like:

    model = CpModel()
    model.new_bool_var("mySuperBoolVar")

    # ...many lines later...

    bv = model.get_bool_var_by_name("mySuperBoolVar")


    Obviously, get_bool_var_by_name() doesn't exist. There's only model.get_bool_var_from_proto_index(), but I have no idea what does it do...

    Continue reading...

Compartilhe esta Página