Skip to content
Snippets Groups Projects
Commit 0c41cd88 authored by Jaime Arias's avatar Jaime Arias
Browse files

Merge branch 'feature/documentation' into develop

parents 091fc072 806ed9ce
No related branches found
No related tags found
No related merge requests found
......@@ -41,4 +41,10 @@ Examples
docs/html
docs/latex
# build folder
build
# visual studio configuration
.vscode
# End of https://www.gitignore.io/api/c++
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 3.0.0)
# Project information
project(adt2amas CXX)
# Project folders
add_subdirectory(src)
# add_subdirectory(test)
# Style Guide
We use the Google C++ Style Guide that can be found at https://google.github.io/styleguide/cppguide.html
\ No newline at end of file
We use the Google C++ Style Guide that can be found at https://google.github.io/styleguide/cppguide.html
# Testing
We use the test framework [catch2](https://github.com/catchorg/Catch2) for writing and running the test cases.
# ADT2AMAS
Tool for transforming Attack-Defense Trees (ADTrees) into Asynchronous Multi-Agent Systems (AMAS).
# Dependencies
- `cmake`
# Build
1. `mkdir build`
2. `cd build`
3. `cmake ..`
4. `make`
This diff is collapsed.
#include "ADtree.hh"
#include "ADtree.hpp"
// Tree implementation adapted from: https://gist.github.com/toboqus/def6a6915e4abd66e922
......@@ -125,4 +125,4 @@ int ADtree::empty_tree(TreeNode *node){
return 1;
else
return 0;
}
\ No newline at end of file
}
#ifndef ADTREE_H
#define ADTREE_H
#ifndef ADTREE_HPP
#define ADTREE_HPP
#include "TreeNode.hh"
#include "tree_node.hpp"
class ADtree{
......@@ -34,4 +34,4 @@ class ADtree{
int empty_tree(TreeNode *node);
};
#endif
\ No newline at end of file
#endif
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 3.0.0)
# project information
project(adt2amas_exec CXX)
# Libraries
add_library(adt_libs ADtree.cpp tree_node.cpp node_type.hpp)
target_include_directories(adt_libs PUBLIC ${CMAKE_CURRENT_LIST_DIR})
# The main programn
add_executable(adt2amas adt2amas.cpp)
target_link_libraries(adt2amas adt_libs)
#include "ADtree.hh"
// g++ -std=c++17 MainADtree.cc ADtree.cpp TreeNode.cpp NodeType.hh TreeNode.hh ADtree.hh
#include "ADtree.hpp"
// g++ -std=c++17 adt2amas.cpp ADtree.cpp tree_node.cpp node_type.hpp tree_node.hpp ADtree.hpp
int main(){
......@@ -26,4 +26,4 @@ int main(){
NodeType nodeTest{NodeType::Defence};
cout << "node type = " << static_cast<int>(nodeTest) << endl;
}
\ No newline at end of file
}
#ifndef NODETYPE_H
#define NODETYPE_H
#ifndef NODE_TYPE_HPP
#define NODE_TYPE_HPP
#include <iostream>
......@@ -7,7 +7,7 @@ using namespace std;
enum class NodeType
{
Defence, // 0
Defence, // 0
Attack // 1
};
#endif
\ No newline at end of file
#endif
#include "TreeNode.hh"
#include "tree_node.hpp"
/* Gets */
......@@ -69,4 +69,4 @@ void TreeNode::set_nextSibling (TreeNode *changenextSibling)
this->nextSibling = changenextSibling;
}
/* Others methods*/
\ No newline at end of file
/* Others methods*/
#ifndef TREENODE_H
#define TREENODE_H
#ifndef TREE_NODE_HPP
#define TREE_NODE_HPP
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
//#include <fstream>
#include "NodeType.hh"
#include "node_type.hpp"
using namespace std;
......@@ -22,9 +22,9 @@ class TreeNode{
TreeNode *parent;
TreeNode *firstChild;
TreeNode *nextSibling;
public:
/* Gets */
int get_nodeAD();
......@@ -49,4 +49,4 @@ class TreeNode{
/* Others methods*/
};
#endif
\ No newline at end of file
#endif
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 3.0.0)
# project information
project(adt2amas_tests CXX)
# Requires Catch2
find_package(Catch2 REQUIRED)
add_executable(tests test.cpp)
target_link_libraries(tests Catch2::Catch2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment