Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
17e364c
test push
jmalegankar Apr 27, 2026
fae8354
Add memory engine with structured stores and polygon store on graph e…
claude Apr 27, 2026
15cfeb3
Add building / foliage occlusion for sensors (#82)
claude Apr 27, 2026
9ee7ff8
Add tests for memory engine and occlusion
claude Apr 27, 2026
86f153f
Store typing changed for base storage abstraction.
bridgesign Apr 29, 2026
9882b7d
Realign stores, graphs, sensors with new IStore abstraction.
jmalegankar Apr 29, 2026
3cf3e1c
Merge pull request #85 from GAMMSim/claude/fervent-poincare-09845b
jmalegankar Apr 29, 2026
86911b8
Incorrect raised error. Need to investigate how it was passing before
bridgesign May 14, 2026
a644de0
Revert. Error based on what gets processed first.
bridgesign May 14, 2026
de7639c
Initial working refactor for store implementation
bridgesign May 14, 2026
a32bb86
polygon api
bridgesign May 15, 2026
6483148
Rendering optimization #78 (#81) (#88)
bridgesign May 15, 2026
c56c0c8
Created face type. Bug correction in height calculation. Created visu…
bridgesign May 15, 2026
640c174
Add api update
bridgesign May 15, 2026
ce463b0
Merge branch 'dev' into claude/memory-engine-occlusion-4T55m
bridgesign May 16, 2026
8d1ac93
Potential fix for pull request finding
bridgesign May 16, 2026
1af8cb6
Correcthandling for missing columns
bridgesign May 16, 2026
2f55bdd
Consistent behavior across stores
bridgesign May 16, 2026
e59b076
Optimizing draws by selected retreival
bridgesign May 16, 2026
02622bf
fixed occluded sensors + tests
jmalegankar May 18, 2026
0f9676b
viewport retreival correction
bridgesign May 19, 2026
205e8c6
Merge branch 'dev' into claude/memory-engine-occlusion-4T55m
bridgesign May 19, 2026
856971b
Remove claude files. Do not add to gitignore. instead avoid using A…
bridgesign May 19, 2026
1e3759a
fix attempt, got rid of extra sensors, now accepting fov and range as…
jmalegankar May 19, 2026
68215a0
Merge branch 'claude/memory-engine-occlusion-4T55m' of https://github…
jmalegankar May 19, 2026
803e0f1
removed legacy functions and tested occluded sensors in game
jmalegankar May 19, 2026
c3272a5
tested occlusion sensors in a game loop
jmalegankar May 19, 2026
c4d0ff6
more tests
jmalegankar May 19, 2026
85d6742
tests
jmalegankar May 19, 2026
4ef1e42
manual fixes to sensors + vectorized iterator of faces
jmalegankar May 20, 2026
3a55f91
Optimizing chunk construction
bridgesign May 21, 2026
7265257
grid test
jmalegankar May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,6 @@ cython_debug/
*.prof

# OS files
.DS_Store
.DS_Store

.claude/
4 changes: 2 additions & 2 deletions examples/base/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import math

# Visualization
vis_engine = gamms.visual.Engine.PYGAME
vis_engine = gamms.visual.Engine.NO_VIS

# The path to the graph file
location = "West Point, New York, USA"
location = "La Jolla, CA, USA"
resolution = 10.0
graph_path = 'graph.pkl'

Expand Down
106 changes: 106 additions & 0 deletions examples/occlusion_game/ucsd_game.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import gamms
from gamms import osm as gamms_osm

import math

LOCATION = "University of California San Diego, La Jolla, CA, USA"
RESOLUTION = 10.0
SENSOR_RANGE = 80.0
SENSOR_FOV = math.radians(360) # 120° cone

# ---------------------------------------------------------------------------
# Load graph
# ---------------------------------------------------------------------------
print("Fetching UCSD walk graph from OSM...")
G = gamms_osm.create_osm_graph(LOCATION, gamms_osm.OSMType.WALK, resolution=RESOLUTION)
print(f" {G.number_of_nodes()} nodes, {G.number_of_edges()} edges")

# ---------------------------------------------------------------------------
# Create context and attach graph
# ---------------------------------------------------------------------------
ctx = gamms.create_context(
graph_engine=gamms.graph.Engine.MEMORY,
vis_engine=gamms.visual.Engine.PYGAME,
vis_kwargs={"width": 1600, "height": 900},
)
ctx.graph.attach_networkx_graph(G)

# ---------------------------------------------------------------------------
# Load buildings
# ---------------------------------------------------------------------------
print("Fetching UCSD buildings from OSM (may take ~30s)...")
face_count = 0
for face in gamms_osm.obstacle_from_osm(LOCATION):
ctx.graph.add_obstacle_face(
face["face_id"],
tr=face["tr"],
tl=face["tl"],
br=face["br"],
bl=face["bl"],
type=face["type"],
)
face_count += 1
print(f" {face_count} building wall faces loaded")

# ---------------------------------------------------------------------------
# Sensors + agent
# ---------------------------------------------------------------------------
start_node = next(ctx.graph.graph.get_nodes())

ctx.sensor.create_sensor("neighbor", gamms.sensor.SensorType.NEIGHBOR)
ctx.sensor.create_sensor(
"arc",
gamms.sensor.SensorType.ARC,
sensor_range=SENSOR_RANGE,
fov=SENSOR_FOV,
)
ctx.sensor.create_sensor(
"occ_map",
gamms.sensor.SensorType.OCCLUDED_MAP,
sensor_range=SENSOR_RANGE,
fov=SENSOR_FOV,
)

ctx.agent.create_agent("player", sensors=["neighbor", "arc", "occ_map"], start_node_id=start_node)
ctx.sensor.get_sensor("arc").set_owner("player")
ctx.sensor.get_sensor("occ_map").set_owner("player")

# ---------------------------------------------------------------------------
# Visuals
# ---------------------------------------------------------------------------
ctx.visual.set_graph_visual()
ctx.visual.set_obstacle_visual()
ctx.visual.set_agent_visual("player", color="blue", size=10)
ctx.visual.set_sensor_visual("arc", node_color=(255, 200, 0), edge_color=(200, 160, 0))
ctx.visual.set_sensor_visual("occ_map", node_color=(0, 220, 220), edge_color=(0, 180, 180))

# ---------------------------------------------------------------------------
# Game loop
# ---------------------------------------------------------------------------
print("\n=== Game started ===\n")

turn = 0
while not ctx.is_terminated():
agent = ctx.agent.get_agent("player")
state = agent.get_state()

arc_data = state["sensor"]["arc"][1]
occ = state["sensor"]["occ_map"][1]
arc_nodes = arc_data.get("nodes", {})
vis_nodes = occ.get("nodes", {})
neighbors = state["sensor"]["neighbor"][1]
hidden = len(arc_nodes) - len(vis_nodes)

turn += 1
print(f"Turn {turn:>3} | node {agent.current_node_id:>6} "
f"| arc: {len(arc_nodes):>4} occluded: {len(vis_nodes):>4} hidden by buildings: {hidden:>4} "
f"| neighbors: {sorted(neighbors)}")

next_node = ctx.visual.human_input("player", state)
state["action"] = next_node
agent.set_state()

ctx.visual.simulate()

ctx.terminate()
print("Game over.")
Loading