Skip to main content

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

jijzept_dashboard_client-0.1.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

jijzept_dashboard_client-0.1.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file jijzept_dashboard_client-0.1.2.tar.gz.

File metadata

File hashes

Hashes for jijzept_dashboard_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 22f262de4ec079982acbd3d15eb4f6d03c5e69340d2fa74c30c7dfc97bb532f6
MD5 a2264685452328905c0d43acd9c67a71
BLAKE2b-256 3b0f83f2d638a6a3e323b220fb7b5851360eb7723be91a3c601044a006f6c13e

See more details on using hashes here.

File details

Details for the file jijzept_dashboard_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jijzept_dashboard_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 47c0c4937d109e8a180a177502b7021b34e24cb8f4f979a57de0b7a16286f353
MD5 385f7baf46d6e83d768221e43af8ae8e
BLAKE2b-256 67877ad557b77453f99a7d352fba24a5adae60102ca8d3057c2b10570fa7061b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page