diff --git a/.gitignore b/.gitignore index e7f9803..d53631f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ test_tree.py test_graph.py test_unit.py test.py +build +dist +*.egg-info diff --git a/LICENCE b/LICENCE index d4092bf..f20c62e 100644 --- a/LICENCE +++ b/LICENCE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Srajan Chourasia +Copyright (c) 2024 Srajan Chourasia, Varun Patrikar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index cf56686..75279f7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ - - Traverse Craft Logo + Traverse Craft Logo @@ -13,7 +12,7 @@ ![Supported OS: Windows](https://img.shields.io/badge/Windows-%234285F4.svg?logo=windows&logoColor=white) ![Supported OS: macOS](https://img.shields.io/badge/macOS-%23000000.svg?logo=apple&logoColor=white) ![Supported OS: Linux](https://img.shields.io/badge/Linux-%23FCC624.svg?logo=linux&logoColor=black) -[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue)](/docs/ "Go to library documentation") +[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue)](/docs/ReadMe.md "Go to library documentation") [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/srajan-kiyotaka/TraverseCraft/blob/main/LICENCE) ![Last Commit](https://img.shields.io/github/last-commit/srajan-kiyotaka/TraverseCraft.svg) [![GitHub Repo Stars](https://img.shields.io/github/stars/srajan-kiyotaka/TraverseCraft.svg?style=social)](https://github.com/srajan-kiyotaka/Pothole-Mapping-Project) @@ -30,9 +29,9 @@ -TraverseCraft is a cross-platform simulation tool written in Python, designed as a library for simulating various algorithms in real time. TraverseCraft allows users to create custom worlds, populate them with agents, and observe how different algorithms operate within these environments. The library leverages the [tkinter](https://docs.python.org/3/library/tkinter.html#module-tkinter) library for fast and responsive simulations. Whether you're a student, educator, or researcher, TraverseCraft provides an intuitive framework to create, visualize, and interact with different world type using their respective agents. +TraverseCraft is a ***cross-platform simulation tool*** written in Python, designed as a library for simulating various algorithms in real time. TraverseCraft allows users to create custom worlds, populate them with agents, and observe how different algorithms operate within these environments. The library leverages the [tkinter](https://docs.python.org/3/library/tkinter.html#module-tkinter) library for ***fast and responsive simulations***. Whether you're a student, educator, or researcher, TraverseCraft provides an intuitive framework to create, visualize, and interact with different world type using their respective agents. -Please visit the our official [website]() for more information. +Please visit the our official [website](https://github.com/srajan-kiyotaka/TraverseCraft/tree/main) for more information. ## Features @@ -74,7 +73,7 @@ pip install traversecraft conda install -c conda-forge traverse-craft ``` -For detailed installation instructions, refer to our installation guide. +For detailed installation instructions, refer to our [installation guide](). ## Getting Started @@ -127,7 +126,7 @@ If you use Traverse Craft in your research or publications, please cite our libr ```bibtex @misc{traversecrafthq2024, - author = {Srajan Chourasia, Varun}, + author = {Srajan Chourasia, Varun Patrikar}, title = {Traverse Craft: A Cross-Platform Simulation Tool}, year = {2024}, url = {https://github.com/srajan-kiyotaka/TraverseCraft}, diff --git a/docs/graphAgent.md b/docs/graphAgent.md index 4f3dd4a..fd547a3 100644 --- a/docs/graphAgent.md +++ b/docs/graphAgent.md @@ -2,11 +2,7 @@ The `GraphAgent` class represents an agent that operates within a graph world. This agent can move between nodes, execute algorithms, and update a heat map to visualize the agent's path. -## Initialization - -### `__init__(self, world, agentName:str, agentColor:str="blue", startNodeId=None, heatMapView:bool=True, heatMapColor:str="#FFA732", heatGradient:float=0.05)` - -The constructor initializes an instance of the `GraphAgent` class, which represents an agent operating within a graph-based world. +## Parameters - **Parameters**: - `world` (`CreateGraphWorld`): The graph world object that the agent belongs to. diff --git a/docs/graphWorld.md b/docs/graphWorld.md index 70f1bfe..0255c14 100644 --- a/docs/graphWorld.md +++ b/docs/graphWorld.md @@ -2,13 +2,7 @@ Class representing a graph world. -## Constructor - -### `__init__(self, worldName: str, worldInfo: dict, radius: int = 20, fontSize: int = 12, fontBold: bool = True, fontItalic: bool = True, nodeColor: str = "gray", goalColor: str = "green", width: int = SCREEN_WIDTH, height: int = SCREEN_HEIGHT, lineThickness: int = 2, arrowShape: tuple = (10, 12, 5), buttonBgColor: str = "#7FC7D9", buttonFgColor: str = "#332941", textFont: str = "Helvetica", textSize: int = 24, textWeight: str = "bold", buttonText: str = "Start Agent", logoPath: str = None)` - -The constructor method for CreateGraphWorld, which initializes an instance of the class representing a graph world. It takes various parameters such as worldName, worldInfo, and optional parameters for visualization settings like radius, fontSize, and nodeColor. It sets up the graphical representation of the world using Tkinter for visualization and constructs the graph data structure based on the provided worldInfo. - -#### Parameters +## Parameters - `worldName` (str): The name of the world. - `worldInfo` (dict): Dictionary containing information about the world. diff --git a/docs/gridWorld.md b/docs/gridWorld.md index 508373a..3298b51 100644 --- a/docs/gridWorld.md +++ b/docs/gridWorld.md @@ -8,13 +8,7 @@ Class representing the world created using grids. - `coordinate`: `List[int]` - `worldID`: `"GRIDWORLD"` -## Constructor - -### `__init__(self, worldName:str, rows:int, cols:int, cellSize:int=10, pathColor:str="gray", blockColor:str="red", goalColor:str="green", cellPadding:int=2, borderWidth:int=1, buttonBgColor:str="#7FC7D9", buttonFgColor:str="#332941", textFont:str="Helvetica", textSize:int=24, textWeight:str="bold", buttonText:str="Start Agent", logoPath:str=None)` - -The constructor initializes an instance of the CreateGridWorld class, setting up various attributes that define the world. It takes parameters such as worldName (the name of the world), rows (number of rows in the grid), cols (number of columns in the grid), and optional parameters for visual aspects like cell size, colors for paths, blocks, and goals, button appearance, and a logo image path. The constructor also validates input parameters to ensure they fall within acceptable ranges or have sensible defaults. - -#### Parameters +## Parameters - `worldName` (`str`): The name of the world. - `rows` (`int`): The number of rows in the world (between 1 and 1000). diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e1cce0d --- /dev/null +++ b/setup.py @@ -0,0 +1,50 @@ +from setuptools import setup, find_packages + +with open("README.md", "r") as f: + long_description = f.read() + +setup( + name='TraverseCraft', + version='0.4.5', + author='Srajan Chourasia, Varun Patrikar', + author_email='srajanstark.ash@gmail.com, patrikarvarun@gmail.com', + maintainer='Srajan Chourasia, Varun Patrikar', + maintainer_email='srajanstark.ash@gmail.com, patrikarvarun@gmail.com', + description='TraverseCraft: Cross-Platform Real-Time Algorithm Simulation Tool', + long_description=long_description, + long_description_content_type='text/markdown', + url='https://official-website.com', # Official website + project_urls={ + 'Documentation': 'https://docs.traverseCraft.com', + 'Source': 'https://github.com/srajan-kiyotaka/TraverseCraft/tree/main', + 'Tracker': 'https://github.com/srajan-kiyotaka/TraverseCraft/tree/main/issues', + 'Reference': 'https://reference.traverseCraft.com', + }, + package_dir={'': 'traverseCraft'}, + packages=find_packages(where='traverseCraft'), + python_requires='>=3.6', + install_requires=[ + 'prettytable', + ], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Topic :: Education', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Scientific/Engineering :: Visualization', + ], + keywords='algorithms, simulation, real-time, tkinter, education, research, visualization, machine learning, reinforcement learning, artificial intelligence, agent-based modeling, cross-platform, dynamic heatmap, world generation, customizable, interactive, framework, algorithm visualization, graph traversal, tree traversal, grid world', +) diff --git a/traverseCraft/world.py b/traverseCraft/world.py index 58aa238..ee621c4 100644 --- a/traverseCraft/world.py +++ b/traverseCraft/world.py @@ -435,7 +435,7 @@ class CreateTreeWorld: - textSize (int): The font size of the button text. Default is 24. - textWeight (str): The font weight of the button text. Default is "bold". - buttonText (str): The text displayed on the buttons. Default is "Start Agent". - - logoPath (str, optional): The file path to the logo image. Default is "design 1.png". + - logoPath (str, optional): The file path to the logo image. Default is traverseCraft logo. Attributes: - worldID (str): Class identifier for the tree world. @@ -930,7 +930,7 @@ class CreateGraphWorld: - textSize (int): The font size of the button text. Default is 24. - textWeight (str): The font weight of the button text. Default is "bold". - buttonText (str): The text displayed on the buttons. Default is "Start Agent". - - logoPath (str, optional): The file path to the logo image. Default is "design 1.png". + - logoPath (str, optional): The file path to the logo image. Default is traverseCraft logo. Attributes: - worldID (str): Class identifier for the graph world. @@ -1013,7 +1013,7 @@ def __init__(self, worldName: str, worldInfo: dict, radius: int = 20, fontSize:i self._canvas = Canvas(self._root, width=self._width, height=self._height, bg="white") self._canvas.pack() self.nodeMap = {} - ## Construct Tree Data Structure ## + ## Construct Graph Data Structure ## if("edges" not in self._worldInfo): self._worldInfo['edges'] = None if("vals" not in self._worldInfo): @@ -1203,7 +1203,7 @@ def _generateGraphDS(self, adj, rootId, parentId=None, edges=None, values=None, def constructWorld(self): """ - Constructs the tree world. + Constructs the graph world. Parameters: self (World): The World instance. @@ -1254,10 +1254,10 @@ def _drawEdges(self, node): def _drawNodes(self, node): """ - Draw the nodes in the tree. + Draw the nodes in the graph. Parameters: - node (TreeNode): The node to draw. + node (GraphNode): The node to draw. Returns: None """ @@ -1295,7 +1295,7 @@ def _drawNodes(self, node): def _addStartButton(self): """ - Add the "Start Agent" button to the tree world. + Add the "Start Agent" button to the graph world. Parameters: None @@ -1303,7 +1303,7 @@ def _addStartButton(self): Returns: None """ - # Find the bottommost point of the tree + # Find the bottommost point of the graph button_y = 100 + max(y for _, y in self._position.values()) button_x = (min(x for x, _ in self._position.values()) + max(x for x, _ in self._position.values())) // 2 @@ -1314,7 +1314,7 @@ def _addStartButton(self): def changeNodeColor(self, nodeId, color): """ - Changes the color of a node in the tree. + Changes the color of a node in the graph. Args: nodeId (int): The ID of the node to change the color of. @@ -1330,7 +1330,7 @@ def changeNodeColor(self, nodeId, color): def changeNodeText(self, nodeId, newText): """ - Changes the text of a node in the tree. + Changes the text of a node in the graph. Parameters: nodeId (int): The ID of the node to change the text of.