dwave-examples / nurse-scheduling Goto Github PK
View Code? Open in Web Editor NEWA demo of a nurse scheduling model
License: Apache License 2.0
A demo of a nurse scheduling model
License: Apache License 2.0
Hi,
When I run python nurse_scheduling.py, following error occurred:
Traceback (most recent call last):
File "nurse_scheduling.py", line 166, in
sampler = LeapHybridSampler()
File "/Users/jinzhe/opt/anaconda3/lib/python3.8/site-packages/dwave/system/samplers/leap_hybrid_sampler.py", line 97, in init
self.client = Client.from_config(
File "/Users/jinzhe/opt/anaconda3/lib/python3.8/site-packages/dwave/cloud/client.py", line 344, in from_config
return _clients_client
File "/Users/jinzhe/opt/anaconda3/lib/python3.8/site-packages/dwave/cloud/client.py", line 386, in init
raise ValueError("API token not defined")
ValueError: API token not defined
I installed dwave with pip install dwave-system.
Could you help me?
Thanks,
I refer to both the hard shift and soft nurse constraint.
In doing my algebra, I wasn't able to reproduce the exact equation found in the documentations for both constraints.
I think I may have gotten rusty at my high school math but please look at the following and enlighten me:
Mine: Expanding the following equation and removing the constant:
lagrange_hard_shift * sum_d ( effort * sum_n q_i(n,d) - workforce ) ** 2
gives me the following:
lagrange_hard_shift * effort ** 2 * sum_d sum_m sum_n q_i(n,d) q_j(m, d) (Similar)
- 2 * lagrange_hard_shift * sum_d sum_n q_i(n,d) * effort * workforce (Different)
Documentation: Notice the (Different) parts - above vs the bottom one:
lagrange_hard_shift * (effort ** 2 - 2 effort * workforce) * sum_d sum_n q_i(n,d) (Different)
+ lagrange_hard_shift * effort ** 2 * sum_d sum_m sum_n q_i(n,d) q_j(m, d) (Similar)
There is an additional effort **2 among other things. Can someone please kindly explain the differences?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.