From 325f00b537559cdd35b925051120832d1520e703 Mon Sep 17 00:00:00 2001 From: srajan-kiyotaka Date: Sat, 15 Jun 2024 10:40:44 +0530 Subject: [PATCH 1/4] modified references --- README.md | 9 ++++----- docs/graphAgent.md | 6 +----- docs/graphWorld.md | 8 +------- docs/gridWorld.md | 8 +------- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8e25d28..2655cce 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - 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 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 2ac5b28..b72e40b 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). From c2aa673aea9cc46ae2f6756b44ff7cb2a57ba9cd Mon Sep 17 00:00:00 2001 From: srajan-kiyotaka Date: Sat, 15 Jun 2024 19:17:20 +0530 Subject: [PATCH 2/4] working on the setup file. --- .gitignore | 3 +++ LICENCE | 2 +- README.md | 2 +- setup.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 setup.py 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 2655cce..f8f2f94 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - Traverse Craft Logo + Traverse Craft Logo diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4c8f656 --- /dev/null +++ b/setup.py @@ -0,0 +1,48 @@ +from setuptools import setup, find_packages + +with open("README.md", "r") as f: + long_description = f.read() + +setup( + name='TraverseCraft', + version='0.3.1', + author='Srajan Chourasia, Varun Patrikar', + author_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', +) From 0df7eea07972cd90fc19a9ccc810413c12bf3a93 Mon Sep 17 00:00:00 2001 From: srajan-kiyotaka Date: Mon, 17 Jun 2024 10:11:17 +0530 Subject: [PATCH 3/4] minor changes in readme and setup files. --- README.md | 2 +- setup.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8f2f94..4bcc9a9 100644 --- a/README.md +++ b/README.md @@ -126,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/setup.py b/setup.py index 4c8f656..e1cce0d 100644 --- a/setup.py +++ b/setup.py @@ -5,9 +5,11 @@ setup( name='TraverseCraft', - version='0.3.1', + 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', From 2dd8d83ef8264231f10e5f08903af82d9857cbba Mon Sep 17 00:00:00 2001 From: srajan-kiyotaka Date: Mon, 17 Jun 2024 10:20:32 +0530 Subject: [PATCH 4/4] fix docstring of world module. --- traverseCraft/world.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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.