This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define (domain cluster) | |
| (:requirements :typing :action-costs) | |
| (:types object - object status - object Filesystem - resource node - object VirtualDomain - resource resource - object libvirtd - resource) | |
| (:constants started - status) | |
| (:predicates (softgoal-mode ) | |
| (on ?on - node ?res - resource) | |
| (stat ?obj - object ?s - status) | |
| (started-softgoal ?res - resource) | |
| (stopped-softgoal ?res - resource) | |
| (started-on-softgoal ?on - node ?res - resource) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from torch import FloatTensor | |
| from torch.autograd import Variable | |
| from opencog.bindlink import execute_atom, evaluate_atom | |
| from opencog.scheme_wrapper import scheme_eval, scheme_eval_h | |
| from opencog.atomspace import TruthValue | |
| from opencog.backwardchainer import BackwardChainer | |
| from opencog.type_constructors import * | |
| from opencog.utilities import initialize_opencog | |
| from opencog.scheme_wrapper import load_scm | |
| import opencog.logger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 2.0 | |
| jobs: | |
| build: | |
| docker: | |
| - image: opencog/opencog-deps | |
| user: root | |
| environment: | |
| PGHOST: opencog-postgres | |
| PGUSER: opencog_test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from opencog.atomspace import AtomSpace, types | |
| from opencog.type_constructors import * | |
| from opencog.atomspace import create_child_atomspace | |
| from opencog.utilities import initialize_opencog, finalize_opencog | |
| from opencog.bindlink import execute_atom, evaluate_atom | |
| a = AtomSpace() | |
| initialize_opencog(a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from opencog.utilities import initialize_opencog, tmp_atomspace | |
| from opencog.type_constructors import * | |
| from opencog.bindlink import execute_atom | |
| def test1(): | |
| atomspace = AtomSpace() | |
| initialize_opencog(atomspace) | |
| imp1 = ImplicationLink( | |
| VariableNode("X0"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| time="2019-08-07T09:27:30Z" level=info msg="Cobra initialized" | |
| time="2019-08-07T09:27:30Z" level=info msg="Using configuration file" configFile=snetd.config.json | |
| time="2019-08-07T09:27:30Z" level=info PaymentChannelStorageServer="&{ID:storage-1 Scheme:http Host:127.0.0.1 ClientPort:2389 PeerPort:2390 Token:unique-token Cluster:storage-1=http://127.0.0.1:2390 StartupTimeout:1m0s Enabled:true DataDir:/opt/singnet/etcd/ropsten/storage-data-dir-1.etcd LogLevel:info}" | |
| time="2019-08-07T09:27:30Z" level=info PaymentChannelStorageServer="&{ID:storage-1 Scheme:http Host:127.0.0.1 ClientPort:2389 PeerPort:2390 Token:unique-token Cluster:storage-1=http://127.0.0.1:2390 StartupTimeout:1m0s Enabled:true DataDir:/opt/singnet/etcd/ropsten/storage-data-dir-1.etcd LogLevel:info}" | |
| time="2019-08-07T09:27:30Z" level=info ClientURL="http://127.0.0.1:2389" | |
| time="2019-08-07T09:27:30Z" level=info PeerURL="http://127.0.0.1:2390" | |
| time="2019-08-07T09:27:30Z" level=info msg="[listening for peers on http://127.0.0.1:2390]" pkg=embed | |
| tim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from gremlin_python import statics | |
| from opencog.atomspace import AtomSpace, types | |
| from opencog.scheme_wrapper import scheme_eval | |
| from gremlin_python.structure.graph import Graph | |
| from gremlin_python.process.graph_traversal import __ | |
| from gremlin_python.process.strategies import * | |
| from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection | |
| from gremlin_python.driver import client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Python.h> | |
| #include <iostream> | |
| // adapted from https://github.com/guowei8412/upp-mirror/blob/0325a2fab45b0b65b8bda7d293d4e03412145826/bazaar/PyTest/main.cpp | |
| void SimpleCall() | |
| { | |
| std::cout << "Invoking a python statement:" << std::endl; | |
| PyRun_SimpleString( "from time import time,ctime\n" | |
| "print('Today is',ctime(time()))\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import numpy | |
| np = numpy | |
| from geomloss import SamplesLoss # See also ImagesLoss, VolumesLoss | |
| # preferences, need to be converted to costs | |
| # row i = cost of moving each item from c to place i | |
| # making cost non-negative will not changes solution matrix P | |
| preference = numpy.asarray([[2, 2, 1 , 0 ,0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| from collections import defaultdict | |
| import json | |
| two_args_re = re.compile('^([\w\s]+)\((\d+)\)') | |
| two_args_re_no = re.compile('^([\w\s]+)\((-)\)') | |
| many_objects = re.compile('^(\w+)\s\((\d+(\,\d+)+)\)') | |
| one_word = re.compile('^(\w+)($)') | |
| s_re = re.compile('([s|o])\s\((.*)\)') |