Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 python 上运行设施位置问题,并且只想运行 10 分钟,因为完整的解决方案需要 2 个多小时。我怎样才能做到这一点?
这取决于您使用的是哪个求解器。但通常它是maxSeconds您创建求解器时的一个参数。例如,假设您正在使用 XPRESS,并且您希望它运行 10 分钟并停止,您可以创建像这样的求解器
maxSeconds
solver = XPRESS(maxSeconds=10 * 60)