JijZeptDashboard-Client
The JijZeptDashboard-Client has two features. The first feature is to add descriptions to your mathematical model using JijModeling. The second feature is to register your mathematical model on the JijZeptDashboard.
How to use
You can register your mathematical model on the JijZeptDashboard as follows:
import jijmodeling as jm
import jijzept_dashboard_client as jdc
# Define your mathematical model with JijModeling
d = jm.Placeholder("d", ndim=2, description="Distance matrix")
N = d.len_at(0, latex="N", description="Number of cities")
i = jm.Element("i", belong_to=(0, N), description="City index")
j = jm.Element("j", belong_to=(0, N), description="City index")
t = jm.Element("t", belong_to=(0, N), description="City index")
x = jm.BinaryVar("x", shape=(N, N), description="Assignment matrix")
problem = jm.Problem("TSP")
problem += jm.sum([i, j], d[i, j] * jm.sum(t, x[i, t] * x[j, (t + 1) % N]))
problem += jm.Constraint("one-city", jm.sum(i, x[i, t]) == 1, forall=t)
problem += jm.Constraint("one-time", jm.sum(t, x[i, t]) == 1, forall=i)
# Add descriptions to your mathematical model
jdc_problem = jdc.Problem.from_jm_problem(
problem,
objective_description="Minimize total distance",
constraint_descriptions={
"one-city": "Each city is visited exactly once",
"one-time": "Each person visits exactly one city",
}
)
# Register your mathematical model on the JijZeptDashboard
client = jdc.JijZeptDashboardClient(
url="*** url for registration ***",
email="*** your email address ***",
password="*** your password ***",
)
response = client.register_model(jdc_problem, project_id=1)
You can add descriptions to the objective function and constraints by
using jdc.Problem.from_jm_problem. On the other hand, to add descriptions
to decision variables, placeholders and elements, you need to use JijModeling.
Define a problem in an alternative way
You can define a mathematical model with descriptions using the constractor
of jdc.Problem as follows:
import jijmodeling as jm
import jijzept_dashboard_client as jdc
# Define your mathematical model with JijModeling
d = jm.Placeholder("d", ndim=2, description="Distance matrix")
N = d.len_at(0, latex="N", description="Number of cities")
i = jm.Element("i", belong_to=(0, N), description="City index")
j = jm.Element("j", belong_to=(0, N), description="City index")
t = jm.Element("t", belong_to=(0, N), description="City index")
x = jm.BinaryVar("x", shape=(N, N), description="Assignment matrix")
problem = jdc.Problem("TSP")
problem += (
jm.sum([i, j], d[i, j] * jm.sum(t, x[i, t] * x[j, (t + 1) % N])),
"Minimize total distance",
)
problem += (
jm.Constraint("one-city", jm.sum(i, x[i, t]) == 1, forall=t),
"Each city is visited exactly once",
)
problem += (
jm.Constraint("one-time", jm.sum(t, x[i, t]) == 1, forall=i),
"Each person visits exactly one city",
)
Metadata
Release files for jijzept-dashboard-client 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jijzept_dashboard_client-0.1.4.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jijzept_dashboard_client-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.1 kB
Release files / jijzept_dashboard_client-0.1.4.tar.gz
| Download URL | jijzept_dashboard_client-0.1.4.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d66434c894d7b30d9da902235d6944c5a1f47308b9f923dfe59b52556d92145
|
|
BLAKE2b-256 checksum How to use checksums |
32f229577880198b4ccc22fa9be5061eb16bab6fef478989bef680ca67b39e8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / jijzept_dashboard_client-0.1.4-py3-none-any.whl
| Download URL | jijzept_dashboard_client-0.1.4-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e6c3ff65f2041a36139bd8ee7d2fcca8012a01c1008dc9f16da8213f9b93348
|
|
BLAKE2b-256 checksum How to use checksums |
6830d8d3a5ffc28b65170c12e5bd450d45a917f1d94a504bf1eb3eb12204acfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|