Giter Club home page Giter Club logo

coco's Introduction

COCO

deduCtiOn and abduCtiOn (COCO) reasoner.

How to use

Use the provided new_coco_project.py script to create a new project.

python3 scripts/new_coco_project.py <project_name>

The Database

Implement a database class that inherits from a coco::coco_db implementation. The coco::mongo_db implementation is provided as an example.

#include "mongo_db.h"

class my_db : public coco::mongo_db
{
  public:
    my_db(const std::string &root = COCO_NAME, const std::string &mongodb_uri = MONGODB_URI(MONGODB_HOST, MONGODB_PORT)) : mongo_db(root, mongodb_uri) {}
};

The Application

Implement your application class that inherits from coco::coco_core and pass the database to the base class constructor.

#include "coco_core.h"

class my_app : public coco::coco_core
{
  public:
    my_app(my_db &db) : coco_core(db) {}
};

The application can be used to extend the COCO reasoner with your own functionality, defining your own User Defined Functions (UDFs) and User Defined Types (UDTs).

The Listener

Implement a listener class that inherits from coco::coco_listener and pass the application to the base class constructor.

#include "coco_listener.h"

class my_listener : public coco::coco_listener
{
  public:
    my_listener(my_app& app) : coco_listener(app) {}
};

Installation of COCO on a local machine

CLIPS

COCO relies on CLIPS for reacting to the dynamic changes which happen into the urban environment.

  • Download CLIPS v6.4.1 and unzip the zip file into the clips_core_source_641 folder.
  • Reach the clips_core_source_641/core folder and compile CLIPS through make release_cpp.
  • Copy all the header files into the /usr/local/include/clips folder through sudo cp *.h /usr/local/include/clips/.
  • Copy the library into the /usr/local/lib folder through sudo cp libclips.a /usr/local/lib/.

MongoDB

COCO relies on MongoDB for storing the data which is collected from the sensors and the participatory data. It is required, in particular, to install the cxx drivers for connecting COCO to a MongoDB database.

Installig OpenSSL

sudo apt-get install libssl-dev

Installing MongoDB cxx drivers

Download and configure the mongoc driver.

git clone https://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
python build/calc_release_version.py > VERSION_CURRENT
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

Compile and install it.

cmake --build .
sudo cmake --build . --target install

Download the mongocxx driver.

curl -OL https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.9.0/mongo-cxx-driver-r3.9.0.tar.gz
tar -xzf mongo-cxx-driver-r3.9.0.tar.gz
cd mongo-cxx-driver-r3.9.0/build

Configure the driver.

cmake .. -DCMAKE_BUILD_TYPE=Release -DMONGOCXX_OVERRIDE_DEFAULT_INSTALL_PREFIX=OFF

Build and install il.

cmake --build .
sudo cmake --build . --target install

Installing MongoDB (optional)

For installation of MongoDB refer to the official documentation.

coco's People

Contributors

riccardodebenedictis avatar

Watchers

 avatar

coco's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.