No project description provided
Project description
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",
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jijzept_dashboard_client-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11355ae2a233c90af53243c612743d584464aeb43e8dc4d69b6b1554d05d9ba9 |
|
MD5 | b5ba7f2708b64200c093231fb85f7a73 |
|
BLAKE2b-256 | ee62eaeed316b9db40974d20c4094ae5b24ab730741ec05925266730c0135c7e |
Hashes for jijzept_dashboard_client-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4937317a40f86e9f2253a8802790e1021a4e7161588efe9c498bf08b8b6a123c |
|
MD5 | 67d3a324cefc8b441ea104fcb7cabc4c |
|
BLAKE2b-256 | 81c641238a32e3d57de5cbb3d6346119522d3fb2ca36004facb066587c0cd44f |