Menu

#53 Problem with soft intensional constraints (functions)

verified
closed-fixed
None
5
2020-05-16
2020-05-13
Gauth
No

Hi,

It seems solving problems with soft intensional constraints (with JaCoPxcspParser) is not working properly, as far as I understand.
Here is a simple such problem, with 2 binary variables, one soft constraint (adding both values). The objective is to maximize this sum, so the solution should be X1 = 1 and X2 = 1, with global utility of 2. The soft constraint is defined in the functions section, with a function. But, when running the following command with the attached problem file:

java -cp frodo2.18.jar frodo2.algorithms.AgentFactory simpleDCOP.xml agents/DPOP/DPOPagentJaCoP.xml

I get the following output:

FRODO  Copyright (C) 2008-2020  Thomas Leaute, Brammert Ottens & Radoslaw Szymanek
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. Use the option -license to display the license.

Parsing the input problem file: ../simpleDCOP.xml
Parsing the input agent configuration file: agents/DPOP/DPOPagentJaCoP.xml
Setting up the agents...
Constraint graph:
graph {
    node [shape = "circle"];
    subgraph cluster_A1 {
        label = A1;
        X2 [style="filled"];
    }
    subgraph cluster_A0 {
        label = A0;
        X1 [style="filled"];
    }


    X2 -- X1;
}

Starting the algorithm...
Chosen DFS tree:
digraph {
    node [shape = "circle"];

    X1 [style="filled"];
    X2 -> X1;

    X2 [style="filled"];

}
var `X2' = 0
var `X1' = 0
Total utility of reported solution: 0
Algorithm finished in 30 ms (simulated time)
Number of messages sent (by type): 
    [ALL, DPOP, UTILpropagation, UTIL]: 1
    [ALL, DPOP, VALUEpropagation, VALUE]:   1
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgeneration, Child]:   3
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgeneration, ScoreBroadcastingHeuristic, HeuristicScoreSingleVar]: 2
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgenerationParallel, ReleaseDFSoutput]:    1

    - Total:    8
Number of messages sent (by agent): 
    A0: 4
    A1: 4
Number of messages received (by agent): 
    A0: 4
    A1: 4
Amount of information sent (by type, in bytes): 
    [ALL, DPOP, UTILpropagation, UTIL]: 331
    [ALL, DPOP, VALUEpropagation, VALUE]:   222
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgeneration, Child]:   384
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgeneration, ScoreBroadcastingHeuristic, HeuristicScoreSingleVar]: 834
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgenerationParallel, ReleaseDFSoutput]:    83
    - Total:    1854
Amount of information sent (by agent, in bytes): 
    A0: 966
    A1: 888
Amount of information received (by agent, in bytes): 
    A0: 888
    A1: 966
Size of the largest message sent (by type, in bytes): 
    [ALL, DPOP, UTILpropagation, UTIL]: 331
    [ALL, DPOP, VALUEpropagation, VALUE]:   222
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgeneration, Child]:   166
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgeneration, ScoreBroadcastingHeuristic, HeuristicScoreSingleVar]: 417
    [ALL, VarOrdering, DFSgenerationParallel, ParallelDFSwrapper, VarOrdering, DFSgenerationParallel, ReleaseDFSoutput]:    83
    - Overall maximum:  417

I hope I made no coding or experimental error.

Best,

Gauthier

1 Attachments

Discussion

  • Thomas B. Léauté

    • status: open --> pending
    • assigned_to: Thomas B. Léauté
     
  • Thomas B. Léauté

    • Group: unverified --> verified
     
  • Thomas B. Léauté

    Hi Gauthier,

    Thank you for reporting this unexpected behavior.

    I have traced it down to an embarrassing bug in the Predicate constraint, whose utility variable is being accessed before it has been initialized.

    Working on a fix.

    You marked this bug report as private ; does it mean that you would rather not be credited for reporting it in the release notes of the next version?

    Best,

    Thomas

     

    Last edit: Thomas B. Léauté 2020-05-16
    • Gauth

      Gauth - 2020-05-15

      Hi Thomas,
      I suspected Predicate, but I don't have enough Frodo expertise to fully trace it.
      The but report is private by my mistake... No privacy problem here :)
      Best,
      Gauthier

       
  • Thomas B. Léauté

    • private: Yes --> No
     
  • Thomas B. Léauté

    Hi Gauthier,

    I have found a fix.
    Running all unit tests now before I release Version 2.18.1.

    Best,

    Thomas

     
  • Thomas B. Léauté

    • status: pending --> closed-fixed
     
  • Thomas B. Léauté

    Fixed in Version 2.18.1.

     

Log in to post a comment.

MongoDB Logo MongoDB