Coder Social home page Coder Social logo

dwave-examples / job-shop-scheduling Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 31.0 67 KB

Determine a schedule for running a set of jobs.

License: Apache License 2.0

Python 100.00%
constraint-satisfaction-problem manufacturing optimization good-first-example bqm beginner

job-shop-scheduling's People

Contributors

hemantdwave avatar joelpasvolsky avatar m3ller avatar mziele1 avatar randomir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

job-shop-scheduling's Issues

fail in bqm init when max_time is increased

Hello,
While trying this code, I noticed that the method to construct the bqm, get_jss_bqm, breaks when max_time is increased.
I set up a minimal experiment:

  • 2 machines
  • 3 jobs (1st job: 2 ops, 2nd job: 2 ops, 3rd job: 1 op)
  • all ops of take time 1 to complete
    this was solved easily when max_time <= 8 but, as soon as max_time == 9, this is the error that I obtain:
  File "<ipython-input-4-7aaea837e31a>", line 96, in <module>
    bqm = get_jss_bqm(jobs, max_time, stitch_kwargs)

  File "..t/job_shop_scheduler.py", line 74, in get_jss_bqm
    return scheduler.get_bqm(stitch_kwargs)

  File "../job_shop_scheduler.py", line 352, in get_bqm
    bqm = dwavebinarycsp.stitch(self.csp, **stitch_kwargs)

  File "/usr/lib/python3.8/site-packages/dwavebinarycsp/compilers/stitcher.py", line 188, in stitch
    if pmodel.classical_gap >= min_classical_gap:

AttributeError: 'NoneType' object has no attribute 'classical_gap'

I made some edits to the files for visualization purposes so the line number might be different, but this error seems to be quite common (I encountered it also in other set-ups)

Let me know if you can reproduce the error and if you need to know further details. Thank you!

cannot run

Sorry for disturbing you. I am new to python and I want to run the programme to solve a job-shop problem, but I come across an error. I don't know how to solve it and let the programme run. Could you help me? Thank you very much!

Traceback (most recent call last):
  File "C:\Users\14391\Downloads\代码\job-shop-scheduling-master\demo.py", line 31, in <module>
    sampler = EmbeddingComposite(DWaveSampler())
  File "C:\Users\14391\Downloads\代码\job-shop-scheduling-master\venv\lib\site-packages\dwave\system\samplers\dwave_sampler.py", line 161, in __init__
    self.client = Client.from_config(**config)
  File "C:\Users\14391\Downloads\代码\job-shop-scheduling-master\venv\lib\site-packages\dwave\cloud\client.py", line 344, in from_config
    return _clients[_client](**config)
  File "C:\Users\14391\Downloads\代码\job-shop-scheduling-master\venv\lib\site-packages\dwave\cloud\client.py", line 386, in __init__
    raise ValueError("API token not defined")
ValueError: API token not defined

Input not working

Why below input it not working
jobs = {"cupcakes": [("mixer", 1), ("oven", 4)],
"smoothie": [("mixer", 1), ("oven", 3)],
"lasagna": [("oven", 2)]}
max_time = 10

same is the case with
jobs = {"group1": [("man", 2), ("robo", 1)],
"group2": [("man", 1), ("robo", 2)],
"group3": [("man", 2), ("robo", 1)]}

Missing modules!

Re: demo py

from dwave.system.composites import EmbeddingComposite
from dwave.system.samplers import DWaveSampler

Missing from the package. Not even a comment about where one can find them!

👎

Failure post-processing solution with max_time=5

To reproduce, change max_time in demo.py from 4 to 5. May require a few runs to trigger the error. The exception is:

Traceback (most recent call last):
  File "demo.py", line 66, in <module>
    job_name, task_time = node.rsplit("_", 1)
ValueError: not enough values to unpack (expected 2, got 1)

The value of the variable node is aux0.

Modify the jobs so they are industry relevant

It would be beneficial to have jobs that are relatable to folks in manufacturing.

Suggestion: change baking cupcakes and making a smoothie to bicycle assembly (frame, drive train, wheels, brakes, headset, handlebars, etc) since it's a small change and is relatable to a larger audience.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.