This repository was archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move nearby_distance_meter to heuristic
- Loading branch information
1 parent
d5440fe
commit 504451f
Showing
6 changed files
with
34 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
timefold-solver-python-core/src/main/python/heuristic/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from ._nearby_selection import * |
20 changes: 20 additions & 0 deletions
20
timefold-solver-python-core/src/main/python/heuristic/_nearby_selection.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import Callable, TypeVar | ||
from .._timefold_java_interop import ensure_init, register_java_class | ||
|
||
Origin_ = TypeVar('Origin_') | ||
Destination_ = TypeVar('Destination_') | ||
|
||
|
||
def nearby_distance_meter(distance_function: Callable[[Origin_, Destination_], float], /) \ | ||
-> Callable[[Origin_, Destination_], float]: | ||
ensure_init() | ||
from jpyinterpreter import translate_python_bytecode_to_java_bytecode, generate_proxy_class_for_translated_function | ||
from ai.timefold.solver.core.impl.heuristic.selector.common.nearby import NearbyDistanceMeter # noqa | ||
java_class = generate_proxy_class_for_translated_function(NearbyDistanceMeter, | ||
translate_python_bytecode_to_java_bytecode( | ||
distance_function, | ||
NearbyDistanceMeter)) | ||
return register_java_class(distance_function, java_class) | ||
|
||
|
||
__all__ = ['nearby_distance_meter'] |