SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.04429 · AAAI · 2024

i-Rebalance: Personalized Vehicle Repositioning for Supply Demand Balance

Haoyang Chen, Weiwei Wu, Wanyuan Wang, Yan Lyu, Peiyan Sun, Qiyuan Song, Wencan Zhang, Guanyu Gao

arXiv · PDF · Open in the Atlas

Code that ran

7 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 6 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2401.04429.json · badge: /api/ran/2401.04429.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Haoyang-Chen/i-Rebalance canonical (classifier label)
classifier basis: census
7 ran · 6 no recorded run
FunctionStatusWhere it lives
Des_Weight Ran
ran, honoured the contract we drafted
Haoyang-Chen/i-Rebalance/simulator/Experiments/MinCostFlow.py
code served (permissive licence) · get_code("6f0791faea74b60b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Stand-in classes for the required objects
class Node:
    def __init__(self, node_id):
        self.id = node_id

class Cluster:
    def __init__(self):
        self.Nodes = [Node(0), Node(1), Node(2)]
        self.IdleVehicles = [1, 2, 3]  # List of idle vehicle identifiers

class Vehicle:
    def __init__(self):
        self.LocationNode = Node(99)

class MockSelf:
    def __init__(self):
        pass
    
    def RoadCost(self, node1, node2):
        # Simple mock: return a small positive float based on node ids
        return 2.5

# Create instances
mock_self = MockSelf()
cluster = Cluster()
vehicle = Vehicle()

# Map function parameters to arguments
ARGS = {
    'self': mock_self,
    'cluster': cluster,
    'vehicle': vehicle
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Disp_GetStateFunction Ran
ran; our contract draft was wrong, not the code
Haoyang-Chen/i-Rebalance/simulator/Experiments/tes_Collective_Pre.py
code served (permissive licence) · get_code("0b92c67432a3dc11")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (18,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

KAPPA = 8

class MockNeighbor:
    def __init__(self, id):
        self.ID = id

class MockCluster:
    def __init__(self, cluster_id, neighbors):
        self.ID = cluster_id
        self.Neighbor = neighbors

class MockSelf:
    def __init__(self):
        self.DemandExpect = np.array([10.0, 12.0, 8.0, 15.0, 11.0])
        self.SupplyExpect = np.array([20.0, 25.0, 18.0, 30.0, 22.0])
        self.idx_map = {
            (0, 1): 0,
            (0, 2): 1,
            (0, 3): 2,
            (0, 4): 3,
            (1, 0): 4,
            (1, 2): 5,
            (1, 3): 6,
            (1, 4): 7,
        }
    
    def Getidx(self, cluster_id, neighbor_id):
        key = (cluster_id, neighbor_id)
        return self.idx_map.get(key, 0)

np.random.seed(0)

self_obj = MockSelf()
neighbors = [MockNeighbor(1), MockNeighbor(2), MockNeighbor(3)]
cluster = MockCluster(0, neighbors)
pre_idxs = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0])

ARGS = {
    'self': self_obj,
    'cluster': cluster,
    'pre_idxs': pre_idxs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (18,) — shape (18,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GetStateFunction Ran
ran; our contract draft was wrong, not the code
Haoyang-Chen/i-Rebalance/simulator/Experiments/RANDOM.py
code served (permissive licence) · get_code("f5b46a62a9b21514")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a minimal Cluster class
class Cluster:
    def __init__(self, cluster_id, neighbors=None):
        self.ID = cluster_id
        self.Neighbor = neighbors if neighbors is not None else []

# Create a minimal self object with required attributes and methods
class TaxiDispatchSystem:
    def __init__(self):
        self.SupplyExpect = {0: 10.5, 1: 5.2, 2: 8.1, 3: 3.7, 4: 6.9, 5: 4.3, 6: 7.1, 7: 2.5, 8: 9.8}
        self.DemandExpect = {0: 12.3, 1: 6.8, 2: 7.5, 3: 4.2, 4: 8.1, 5: 5.6, 6: 6.3, 7: 3.1, 8: 10.2}
        self.cluster_pair_map = {
            (0, 1): 1, (0, 2): 2, (0, 3): 3, (0, 4): 4,
            (0, 5): 5, (0, 6): 6, (0, 7): 7, (0, 8): 8
        }
    
    def Getidx(self, cluster_id_from, cluster_id_to):
        key = (cluster_id_from, cluster_id_to)
        return self.cluster_pair_map.get(key, 0)
    
    def GetStateFunction(self, vehicle_id, cluster, pre_idxs):
        """
        for each dispatched taxi i do
            observe state s^i_t
            Store tuple (s,a,r,s) into M
        """
        state = []
        cCluster = cluster
        state.append(cCluster.ID)
        state.append(int(self.SupplyExpect[cCluster.ID]))
        state.append(int(self.DemandExpect[cCluster.ID]))
        state.append(pre_idxs[4])
        nClusters = cCluster.Neighbor
        for neighbour in nClusters:
            state.append(int(self.SupplyExpect[neighbour.ID]))
            state.append(int(self.DemandExpect[neighbour.ID]))
            state.append(pre_idxs[self.Getidx(cluster.ID, neighbour.ID)])
        KAPPA = 8
        while len(state) < (KAPPA + 1) * 3 + 1:
            state.append(0)
        if len(state) > (KAPPA + 1) * 3 + 1:
            state = state[:(KAPPA + 1) * 3 + 1]
        return state

# Create neighbor clusters
neighbor_1 = Cluster(cluster_id=1)
neighbor_2 = Cluster(cluster_id=2)
neighbor_3 = Cluster(cluster_id=3)

# Create main cluster with neighbors
main_cluster = Cluster(cluster_id=0, neighbors=[neighbor_1, neighbor_2, neighbor_3])

# Create system instance
system = TaxiDispatchSystem()

# Create pre_idxs array (needs to have at least index 4 and indices for neighbor mappings)
pre_idxs = [0, 1, 2, 3, 15, 5, 6, 7, 8, 9]

# Define ARGS
ARGS = {
    'self': system,
    'vehicle_id': 42,
    'cluster': main_cluster,
    'pre_idxs': pre_idxs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Seq_GetStateFunction Ran
ran; our contract draft was wrong, not the code
Haoyang-Chen/i-Rebalance/simulator/Experiments/tes_Disp_Seq.py
code served (permissive licence) · get_code("9d8ab6b598bde3bb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

class DummyModel:
    pass

# Construct mat_diff as a tensor that can be converted to list
# The function calls mat_diff.tolist(), so it needs to be a tensor
mat_diff = torch.randn(4, 3)

# Construct pre_idxs_batch as a list of tensors
# The function iterates through pre_idxs_batch and calls .tolist() on each element
pre_idxs_batch = [torch.randn(2, 5) for _ in range(2)]

# Create a dummy self object
self = DummyModel()

ARGS = {
    "self": self,
    "mat_diff": mat_diff,
    "pre_idxs_batch": pre_idxs_batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
string_datetime Ran
ran; our contract draft was wrong, not the code
Haoyang-Chen/i-Rebalance/preprocessing/readfiles.py
code served (permissive licence) · get_code("870796c384879b7b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned datetime. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import datetime as dt

ARGS = {
    'value': '2024-01-15 14:30:45'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type datetime — a datetime output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a datetime output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
string_pdTimestamp Ran
ran; our contract draft was wrong, not the code
Haoyang-Chen/i-Rebalance/preprocessing/readfiles.py
code served (permissive licence) · get_code("1bca55a2aa827c66")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Timestamp. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import datetime as dt
import pandas as pd

def string_datetime(value):
    return dt.datetime.strptime(value, '%Y-%m-%d %H:%M:%S')

def string_pdTimestamp(value):
    d = string_datetime(value)
    t = pd.Timestamp(d.year, d.month, d.day, d.hour, d.minute)
    return t

# The function takes a single parameter 'value' which should be a string
# in the format '%Y-%m-%d %H:%M:%S'
ARGS = {
    'value': '2023-06-15 14:30:45'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Timestamp — a Timestamp output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Timestamp output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
timestamp_datetime Ran
ran; our contract draft was wrong, not the code
Haoyang-Chen/i-Rebalance/preprocessing/readfiles.py
code served (permissive licence) · get_code("df1382119ba1bfff")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned datetime. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import datetime as dt
from datetime import datetime

def timestamp_datetime(value):
    d = datetime.fromtimestamp(value)
    t = dt.datetime(d.year, d.month, d.day, d.hour, d.minute, 0)
    return t

# A valid timestamp value (e.g., seconds since epoch)
# Using a known timestamp: 1609459200 corresponds to 2021-01-01 00:00:00 UTC
timestamp_value = 1609459200

ARGS = {
    "value": timestamp_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type datetime — a datetime output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a datetime output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Can_Weight Not yet run
unverified (harvested, no recorded run)
Haoyang-Chen/i-Rebalance/simulator/Experiments/MinCostFlow.py
code served (permissive licence) · get_code("ecf6d55c3713be39")
How it ran

no invocation recorded.

GetStateFunction2 Not yet run
unverified (harvested, no recorded run)
Haoyang-Chen/i-Rebalance/simulator/Experiments/tes_COX.py
code served (permissive licence) · get_code("b189ef9671280712")
How it ran

no invocation recorded.

RewardFunction Not yet run
unverified (harvested, no recorded run)
Haoyang-Chen/i-Rebalance/simulator/Experiments/tes_COX.py
code served (permissive licence) · get_code("f57f2a8f2f610e82")
How it ran

no invocation recorded.

RewardFunction Not yet run
unverified (harvested, no recorded run)
Haoyang-Chen/i-Rebalance/simulator/Experiments/tes_Collective_Pre.py
code served (permissive licence) · get_code("75ba8bae277cb485")
How it ran

no invocation recorded.

Score Not yet run
unverified (harvested, no recorded run)
Haoyang-Chen/i-Rebalance/simulator/Experiments/MinCostFlow.py
code served (permissive licence) · get_code("b68f8131553f808c")
How it ran

no invocation recorded.

move Not yet run
unverified (harvested, no recorded run)
Haoyang-Chen/i-Rebalance/simulator/Experiments/RANDOM.py
code served (permissive licence) · get_code("e7929a1429e9922d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Ride-hailing platforms have been facing the challenge of balancing demand and supply. Existing vehicle reposition techniques often treat drivers as homogeneous agents and relocate them deterministically, assuming compliance with the reposition. In this paper, we consider a more realistic and drivercentric scenario where drivers have unique cruising preferences and can decide whether to take the recommendation or not on their own. We propose i-Rebalance, a personalized vehicle reposition technique with deep reinforcement learning (DRL). i-Rebalance estimates drivers' decisions on accepting reposition recommendations through an on-field user study involving 99 real drivers. To optimize supply-demand balance and enhance preference satisfaction simultaneously, i-Rebalance has a sequential reposition strategy with dual DRL agents: Grid Agent to determine the reposition order of idle vehicles, and Vehicle Agent to provide personalized recommendations to each vehicle in the pre-defined order. This sequential learning strategy facilitates more effective policy training within a smaller action space compared to traditional joint-action methods. Evaluation of real-world trajectory data shows that i-Rebalance improves driver acceptance rate by 38.07% and total driver income by 9.97%. The code for our approach is available at https://github.com/Haoyang-Chen/i-Rebalance.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.04429")
get_code_for_paper("2401.04429")
have("2401.04429")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2401.04429.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2401.04429.svg)](https://syntology.ai/paper/2401.04429)

Connect an agent — have() is free.