Class io.singularitynet.offernet.RunCukesTest

0

tests

0

failures

0

ignored

-

duration

-

successful

Tests

Test Duration Result

Standard output

Feature: Agent behaviour
  
  Agents can interact with the graph structure of OfferNet by issuing semantically constrained graph traversals which query or mutate the graph as needed. These define the API of the OfferNet graph.

  #@ignore
  @indoc
  Scenario: an agent can post an {offer-demand} pair to the OfferNet        ?[90m# AgentBehavior.feature:32?[0m
    Agents in an Offer Network engage in exchange by publishing an offer-demand pairs, or 'work's. See explanation of the Offer Network structure in [Data structures and objects].

    ?[32mGiven ?[0m?[32mAgent "?[0m?[32m?[1mAgentOne?[0m?[32m" is created on the OfferNet?[0m                       ?[90m# AgentBehaviorStepDefs.agentIsCreatedOnTheOfferNet(String)?[0m
    ?[32mWhen ?[0m?[32mAgent "?[0m?[32m?[1mAgentOne?[0m?[32m" posts a pair of offer "?[0m?[32m?[1m0.15?[0m?[32m" and demand of "?[0m?[32m?[1m0.57?[0m?[32m"?[0m ?[90m# AgentBehaviorStepDefs.agent_publishes_a_pair_of_offer_and_demand_of(String,Double,Double)?[0m
    ?[32mThen ?[0m?[32mAgent "?[0m?[32m?[1mAgentOne?[0m?[32m" owns a work which "?[0m?[32m?[1mdemands?[0m?[32m" item "?[0m?[32m?[1m0.57?[0m?[32m"?[0m           ?[90m# AgentBehaviorStepDefs.agent_owns_a_work_which_item(String,String,String)?[0m
    ?[32mAnd ?[0m?[32mAgent "?[0m?[32m?[1mAgentOne?[0m?[32m" owns a work which "?[0m?[32m?[1moffers?[0m?[32m" item "?[0m?[32m?[1m0.15?[0m?[32m"?[0m             ?[90m# AgentBehaviorStepDefs.agent_owns_a_work_which_item(String,String,String)?[0m

  #@ignore
  @indoc
  Scenario Outline: an agent can access all posted offers and demands by traversing its social network ?[90m# AgentBehavior.feature:42?[0m
    In a distributed system where there is no global observer which has the registry of all agents and their items of offer and demand. In this case, the only way for an agent to access items of other agents is to traverse its social network (to a given depth) and ask all friends of friends to send information about their items. Since the OfferNet is fully connected (and hopefully is a small world network) the whole network can be scanned this way, depending on availability of time and resource constrains of an agent which initiates the search. The expected number of items that an agent has to find in its social network is calculated as follows: $(numberOfAgents -1) * pairsPerAgent * 2$ (as every pair holds two items: one demand and one offer..).

    ?[36mGiven ?[0m?[36mthere exists an sequentially connected line of '<numberOfAgents>' agents?[0m
    ?[36mAnd ?[0m?[36mall agents have posted '<pairsPerAgent>' offer-demand pair each?[0m
    ?[36mWhen ?[0m?[36mfirst agent initiates search of '<searchDepth>' depth?[0m
    ?[36mThen ?[0m?[36magent finds '<numberOfFoundItems>' demands and offers in its social network?[0m

    Examples: 

  @indoc
  Scenario Outline: an agent can access all posted offers and demands by traversing its social network ?[90m# AgentBehavior.feature:53?[0m
    In a distributed system where there is no global observer which has the registry of all agents and their items of offer and demand. In this case, the only way for an agent to access items of other agents is to traverse its social network (to a given depth) and ask all friends of friends to send information about their items. Since the OfferNet is fully connected (and hopefully is a small world network) the whole network can be scanned this way, depending on availability of time and resource constrains of an agent which initiates the search. The expected number of items that an agent has to find in its social network is calculated as follows: $(numberOfAgents -1) * pairsPerAgent * 2$ (as every pair holds two items: one demand and one offer..).

    ?[32mGiven ?[0m?[32mthere exists an sequentially connected line of '?[0m?[32m?[1m20?[0m?[32m' agents?[0m                                   ?[90m# AgentBehaviorStepDefs.there_exists_an_sequentially_connected_line_of_numberOfAgents_agents(Integer)?[0m
    ?[32mAnd ?[0m?[32mall agents have posted '?[0m?[32m?[1m2?[0m?[32m' offer-demand pair each?[0m                                              ?[90m# AgentBehaviorStepDefs.all_agents_have_posted_pairsPerAgent_offer_demand_pair_each(Integer)?[0m
    ?[32mWhen ?[0m?[32mfirst agent initiates search of '?[0m?[32m?[1m19?[0m?[32m' depth?[0m                                                    ?[90m# AgentBehaviorStepDefs.first_agent_initiates_search_of_searchDepth_depth(Integer)?[0m
    ?[32mThen ?[0m?[32magent finds '?[0m?[32m?[1m76?[0m?[32m' demands and offers in its social network?[0m                                     ?[90m# AgentBehaviorStepDefs.agent_finds_numberOfFoundItems_in_its_social_network(Integer)?[0m

  #@ignore
  @indoc
  Scenario Outline: an agent can connect similar offers and demands of its social network ?[90m# AgentBehavior.feature:57?[0m
    After an agent finds offer and demand items posted by its social network which are similar to its own items, it can connect those items with weighted $similarity$ relations (edges in the graph). Weight of the relation represents the 'strength' of similarity. Definition and computing algorithm of a $similarity$ relation can be chosen by choosing configuration parameters of the OfferNet system during initialization -- allowing to experiment with different approaches. This mechanism addresses these [Open problems / features to consider] of the framework: [Representation / theory of value], [Description of items of exchange], [Similarity measure];

    ?[36mGiven ?[0m?[36ma connected network of '<numberOfAgents>' agents?[0m
    ?[36mGiven ?[0m?[36mthat '<numberOfSimilarItems>' similar item pairs exist in the network?[0m
    ?[36mWhen ?[0m?[36many agent finds similar items by executing search of '<searchDepth>' depth?[0m
    ?[36mThen ?[0m?[36mthere are '<numberOfSimilarityRelations>' similarity relations in the network?[0m

    Examples: 

  @indoc
  Scenario Outline: an agent can connect similar offers and demands of its social network ?[90m# AgentBehavior.feature:68?[0m
    After an agent finds offer and demand items posted by its social network which are similar to its own items, it can connect those items with weighted $similarity$ relations (edges in the graph). Weight of the relation represents the 'strength' of similarity. Definition and computing algorithm of a $similarity$ relation can be chosen by choosing configuration parameters of the OfferNet system during initialization -- allowing to experiment with different approaches. This mechanism addresses these [Open problems / features to consider] of the framework: [Representation / theory of value], [Description of items of exchange], [Similarity measure];

    ?[32mGiven ?[0m?[32ma connected network of '?[0m?[32m?[1m20?[0m?[32m' agents?[0m                                              ?[90m# AgentBehaviorStepDefs.a_connected_network_of_agents(int)?[0m
    ?[32mGiven ?[0m?[32mthat '?[0m?[32m?[1m5?[0m?[32m' similar item pairs exist in the network?[0m                                ?[90m# AgentBehaviorStepDefs.that_similar_items_exist_in_the_network(int)?[0m
    ?[32mWhen ?[0m?[32many agent finds similar items by executing search of '?[0m?[32m?[1m19?[0m?[32m' depth?[0m                  ?[90m# AgentBehaviorStepDefs.any_agent_finds_similar_items_by_executing_search_of_depth(int)?[0m
    ?[31mThen ?[0m?[31mthere are '?[0m?[31m?[1m5?[0m?[31m' similarity relations in the network?[0m                                ?[90m# AgentBehaviorStepDefs.there_are_similarity_relations_in_the_network(int)?[0m
      ?[31mjava.lang.AssertionError: expected:<5> but was:<9>
      	at org.junit.Assert.fail(Assert.java:88)
      	at org.junit.Assert.failNotEquals(Assert.java:834)
      	at org.junit.Assert.assertEquals(Assert.java:645)
      	at org.junit.Assert.assertEquals(Assert.java:631)
      	at io.singularitynet.offernet.AgentBehaviorStepDefs.there_are_similarity_relations_in_the_network(AgentBehaviorStepDefs.java:281)
      	at ✽.Then there are '5' similarity relations in the network(AgentBehavior.feature:63)
      ?[0m
Feature: OfferNet processes
  
  The structure of OfferNet is realized as a Property Graph where agents / offers and demands connect via edges and all is enriched with properties. Agents interact with the graph (query/mutate) by executing  semantically constrained graph traversal processes. The result of these processes depend on the context of operation, but we want to make sure that they are deterministic when the context is known and clearly defined. These processes can be centralized or decentralized.
  
  <realize SimulationTests as scenarios here>

?[31mFailed scenarios:?[0m
?[31mAgentBehavior.feature:68 ?[0m# Scenario Outline: an agent can connect similar offers and demands of its social network

7 Scenarios (?[31m1 failed?[0m, ?[32m6 passed?[0m)
33 Steps (?[31m1 failed?[0m, ?[32m32 passed?[0m)
1m46.567s

java.lang.AssertionError: expected:<5> but was:<9>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:834)
	at org.junit.Assert.assertEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:631)
	at io.singularitynet.offernet.AgentBehaviorStepDefs.there_are_similarity_relations_in_the_network(AgentBehaviorStepDefs.java:281)
	at ✽.Then there are '5' similarity relations in the network(AgentBehavior.feature:63)