InfoAPI icon indicating copy to clipboard operation
InfoAPI copied to clipboard

Compilation of dev.md

Open Endermanbugzjfc opened this issue 3 years ago • 1 comments

What should the document do

  • Explain the differences between parts and paths.
  • Explain the Graph namespace.

Endermanbugzjfc avatar Jul 28 '22 17:07 Endermanbugzjfc

From Copilot:

How Graph Theory is Used in InfoAPI

InfoAPI leverages graph theory to model and automate the process of transforming and retrieving information between different "kinds" of data (such as players, worlds, positions, etc).

  • Nodes (Vertices): Each node in the graph represents a data kind, which is a specific type or entity in the API (e.g., Player, World).
  • Edges: Each edge represents a mapping or transformation that can convert data from one kind to another. These mappings can be explicit (directly defined) or implicit (applied automatically).
  • Paths: A path in the graph is a sequence of edges that connect one kind to another through a series of transformations. Finding the optimal path allows InfoAPI to answer complex queries by chaining together available mappings.

Key Features

  • Automatic Resolution: When a query requires transforming data from one kind to another, InfoAPI uses graph pathfinding algorithms (like Dijkstra's algorithm) to find the shortest or most appropriate sequence of transformations.
  • Extensibility: Adding new mappings or data kinds dynamically extends the graph, making the system flexible and highly modular.
  • Optimization: Costs are assigned to edges, allowing the system to prefer more efficient or direct transformation paths.

Example

Suppose you want to retrieve the money of a player. InfoAPI can automatically chain together mappings such as:

  • Player → PlayerName → Account → Money

By modeling the relationships as a graph and using pathfinding, InfoAPI can handle these queries dynamically and efficiently.


I think this describes pretty much everything relevant.

SOF3 avatar May 29 '25 06:05 SOF3