You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "a class called Environment that provides a set of methods for working with a graphical representation of a building. The main features of the code include:\n\n* Computing the metric map of a building, which involves computing the rooms and doors in the building using a graph structure.\n* Providing functions to draw the rooms and doors on an axis object.\n* Calculating the coordinates of the corners of a room in the room frame, as well as the coordinates of objects within the room.\n\nThe code uses various packages including `networkx` for working with graphs, `matplotlib` for drawing visualizations, and `scipy` for performing rotations and other mathematical operations.",
1272
+
"items": [
1273
+
{
1274
+
"id": "c4e6714a-ada9-308f-774c-0394793a49e1",
1275
+
"ancestors": [],
1276
+
"description": "Provides methods for computing and visualizing a metric map of a long-term graph, including computing the shortest path between two rooms, transforming a room to another location, and drawing the metric map.",
1277
+
"attributes": [
1278
+
{
1279
+
"name": "g",
1280
+
"type_name": "Graph",
1281
+
"description": "Used to represent the graph structure of a building's floor plan, with nodes representing rooms and edges representing doorways between them."
1282
+
},
1283
+
{
1284
+
"name": "read_graph",
1285
+
"type_name": "instance",
1286
+
"description": "Used to read a graph from a file specified by the user."
1287
+
},
1288
+
{
1289
+
"name": "fig",
1290
+
"type_name": "matplotlibFigure",
1291
+
"description": "Used to store the figure object that represents the graph."
1292
+
},
1293
+
{
1294
+
"name": "ax",
1295
+
"type_name": "Axes",
1296
+
"description": "Used to create the figure for visualizing the metric map."
1297
+
}
1298
+
],
1299
+
"name": "LongTermGraph",
1300
+
"location": {
1301
+
"start": 15,
1302
+
"insert": 16,
1303
+
"offset": "",
1304
+
"indent": 4,
1305
+
"comment": null
1306
+
},
1307
+
"item_type": "class",
1308
+
"length": 148,
1309
+
"docLength": null
1310
+
},
1311
+
{
1312
+
"id": "f32bdcfc-bcf0-698c-2049-03de8c3244f5",
1313
+
"ancestors": [
1314
+
"c4e6714a-ada9-308f-774c-0394793a49e1"
1315
+
],
1316
+
"description": "Of the `LongTermGraph` class reads a graph from a file, creates a visualization of it using Python's Matplotlib library, and displays the graph's summary information.",
1317
+
"params": [
1318
+
{
1319
+
"name": "file_name",
1320
+
"type_name": "str",
1321
+
"description": "Used to specify the file name for reading the graph data from."
"description": "Three functions: `draw_graph`, `find_edge_with_attribute`, and `traverse_graph`. The `draw_graph` function takes a graph object as input and uses various libraries (Matplotlib, PySide2) to draw the graph, compute its layout, and display it. The `find_edge_with_attribute` function searches for an edge in a given graph based on a specific attribute, and returns the found edge. Finally, the `traverse_graph` function traverses a graph from a starting room by recursively calling itself for each connected door node, and adding the visited rooms to a list.",
1347
+
"items": [
1348
+
{
1349
+
"id": "176a65d9-3a89-9bb4-a941-c3ee701a553a",
1350
+
"ancestors": [],
1351
+
"description": "Creates a graph using Matplotlib and displays it on a plot. It takes a graph object as input and performs the following operations:\n\n1. Creates a figure and axis object using Matplotlib's `subplots()` function.\n2. Sets the title of the axis object.\n3. Uses the `draw()` method to draw the graph on the canvas.\n4. Uses the `flush_events()` method to update the display.\n5. Clears the axis object.",
1352
+
"params": [
1353
+
{
1354
+
"name": "graph",
1355
+
"type_name": "LTSMGraph",
1356
+
"description": "Used to store the graph structure and layout information."
1357
+
}
1358
+
],
1359
+
"returns": null,
1360
+
"name": "draw_graph",
1361
+
"location": {
1362
+
"start": 9,
1363
+
"insert": 10,
1364
+
"offset": "",
1365
+
"indent": 4,
1366
+
"comment": null
1367
+
},
1368
+
"item_type": "function",
1369
+
"length": 24,
1370
+
"docLength": null
1371
+
},
1372
+
{
1373
+
"id": "4b7258ac-df62-868c-fc45-d991ea036a46",
1374
+
"ancestors": [],
1375
+
"description": "Searches for an edge in a graph that has a specific attribute equal to a given value. If such an edge is found, it returns it; otherwise, it returns `None`.",
1376
+
"params": [
1377
+
{
1378
+
"name": "graph",
1379
+
"type_name": "Graph",
1380
+
"description": "Used to represent a directed or undirected graph consisting of edges and vertices, where each edge has an attribute associated with it."
1381
+
},
1382
+
{
1383
+
"name": "attribute",
1384
+
"type_name": "str",
1385
+
"description": "Used to identify the attribute of the edge to search for in the graph."
1386
+
},
1387
+
{
1388
+
"name": "value",
1389
+
"type_name": "object",
1390
+
"description": "Used to search for an edge in a graph based on a specific attribute."
1391
+
}
1392
+
],
1393
+
"returns": {
1394
+
"type_name": "Edge",
1395
+
"description": "An edge from the graph that has the specified attribute equal to the specified value, or `None` if no such edge exists."
1396
+
},
1397
+
"name": "find_edge_with_attribute",
1398
+
"location": {
1399
+
"start": 44,
1400
+
"insert": 45,
1401
+
"offset": "",
1402
+
"indent": 4,
1403
+
"comment": null
1404
+
},
1405
+
"item_type": "function",
1406
+
"length": 5,
1407
+
"docLength": null
1408
+
},
1409
+
{
1410
+
"id": "d4b423c9-62f5-31a5-9443-83fe6776af73",
1411
+
"ancestors": [],
1412
+
"description": "In Java code extracts edges from a graph that have a \"door\" label in either the source or target node, and appends them to a list.",
1413
+
"params": [
1414
+
{
1415
+
"name": "graph",
1416
+
"type_name": "igraphGraph",
1417
+
"description": "Used to represent a weighted graph."
1418
+
}
1419
+
],
1420
+
"returns": {
1421
+
"type_name": "list",
1422
+
"description": "A collection of edges from a given graph, where each edge connects two nodes representing a room and a door between them."
1423
+
},
1424
+
"name": "get_room_edges",
1425
+
"location": {
1426
+
"start": 50,
1427
+
"insert": 51,
1428
+
"offset": "",
1429
+
"indent": 4,
1430
+
"comment": null
1431
+
},
1432
+
"item_type": "function",
1433
+
"length": 10,
1434
+
"docLength": null
1435
+
},
1436
+
{
1437
+
"id": "4f4720c3-f184-c78d-894f-99ee7d8094fb",
1438
+
"ancestors": [],
1439
+
"description": "In Java returns a list of nodes in a graph that are connected to a given node and have \"door\" in their name. It recursively traverses the graph to find connected door nodes by considering the successors of the given node and recursively calling itself on each successor node until no more connected door nodes are found.",
1440
+
"params": [
1441
+
{
1442
+
"name": "graph",
1443
+
"type_name": "graph",
1444
+
"description": "Used to represent a directed graph with nodes and edges, where each edge has an associated value or weight."
1445
+
},
1446
+
{
1447
+
"name": "node",
1448
+
"type_name": "GraphNode",
1449
+
"description": "Passed as a reference to the method, representing the current node being analyzed for connected door nodes."
1450
+
}
1451
+
],
1452
+
"returns": {
1453
+
"type_name": "list",
1454
+
"description": "A collection of nodes that have at least one connected door node to the given node."
1455
+
},
1456
+
"name": "get_connected_door_nodes",
1457
+
"location": {
1458
+
"start": 61,
1459
+
"insert": 63,
1460
+
"offset": "",
1461
+
"indent": 4,
1462
+
"comment": null
1463
+
},
1464
+
"item_type": "function",
1465
+
"length": 10,
1466
+
"docLength": null
1467
+
},
1468
+
{
1469
+
"id": "51debe0d-e0c1-18bc-7f46-7dd5ace25f0b",
1470
+
"ancestors": [],
1471
+
"description": "Traverses a graph by starting from a designated room and printing its name, then finding and printing the names of connected rooms through doors, and recursively traversing those rooms until no more rooms are found.",
1472
+
"params": [
1473
+
{
1474
+
"name": "graph",
1475
+
"type_name": "Graph",
1476
+
"description": "Used to represent a graph structure with nodes and edges, where each node represents a room and each edge represents a door connecting two rooms."
1477
+
},
1478
+
{
1479
+
"name": "current_room",
1480
+
"type_name": "dict",
1481
+
"description": "Representing the current room being traversed in the graph."
1482
+
},
1483
+
{
1484
+
"name": "visited",
1485
+
"type_name": "list",
1486
+
"description": "Used to store the rooms that have been visited during the traversal, allowing the function to avoid visiting the same room twice."
1487
+
}
1488
+
],
1489
+
"returns": {
1490
+
"type_name": "list",
1491
+
"description": "A list of room names that have been visited during the traversal process."
0 commit comments