es.upv.dsic.gti_ia.argAgents.argCBR
Class ArgCBR

java.lang.Object
  extended by es.upv.dsic.gti_ia.argAgents.argCBR.ArgCBR

public class ArgCBR
extends Object

This class implements the argumentation CBR. This CBR stores argument-cases that represent past argumentation experiences and their final outcome.

Author:
Jaume Jordan

Constructor Summary
ArgCBR(String initialDataFilePath, String storingDataFilePath)
          Constructor that initializes the ArgCBR creating the HashMap structure and loading the argument-cases stored in the indicated path.
 
Method Summary
 boolean addCase(ArgumentCase newArgCase)
          Adds a new argument-case to the case-base.
 void doCache()
          Stores the argument-case case-base in the file path specified in the creation of the class
 void doCache(String fileName)
          Stores the argument-case case-base in the file path specified as argument
 void doCacheInc()
          Stores the argument-case case-base in the file path specified in the creation of the class, but keeping all previous information of that file
 Collection<ArrayList<ArgumentCase>> getAllCases()
          Returns all argument-cases in a Collection
 Vector<ArgumentCase> getAllCasesVector()
          Returns all argument-cases in a Vector
 ArrayList<Float> getAttackDegree(ArrayList<SimilarArgumentCase> sameProblemAcceptedArgCases, ArrayList<Position> initialPositions)
          Returns the attack degree of each given Position
 ArrayList<Float> getDegrees(ArgumentProblem argProblem, Solution solution, ArrayList<Position> allPositions, int index)
          Return a list with the degrees (attack, efficiency, explanatory power, persuasiveness, support and risk) of an argument-case
 ArrayList<Float> getEfficiencyDegree(ArrayList<SimilarArgumentCase> sameProblemAcceptedArgCases, ArrayList<Position> initialPositions)
          Returns the efficiency degree of each initial position
 ArrayList<Float> getExplanatoryPower(ArrayList<SimilarArgumentCase> sameProblemAcceptedArgCases, ArrayList<Position> initialPositions)
          Returns the explanatory power of the given positions
 ArrayList<SimilarArgumentCase> getMostSimilarArgCases(ArgumentProblem argProblem)
          Get the argument-cases with the same domain context as the given argument-case and the same dependency relation.
 ArrayList<SimilarArgumentCase> getSameDomainAndSocialContextAccepted(HashMap<Integer,Premise> premises, Solution solution, SocialContext socialContext)
          Returns the argument-cases with the same domain and social context that have been accepted in teh past
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgCBR

public ArgCBR(String initialDataFilePath,
              String storingDataFilePath)
Constructor that initializes the ArgCBR creating the HashMap structure and loading the argument-cases stored in the indicated path.

Parameters:
initialDataFilePath - Path of the data file with the argument-cases to load
storingDataFilePath - Path of the data file to store the argument-cases
Method Detail

addCase

public boolean addCase(ArgumentCase newArgCase)
Adds a new argument-case to the case-base. If the argument-case is in case-base, the associated domain-cases and the attacks received are added to that argument-case. Two cases are considered equal if they have the same domain context, social context, conclusion and status of acceptability.

Parameters:
newArgCase - A new argument-case to add to the case-base.
Returns:
true if the argument-case is added, otherwise false.

getDegrees

public ArrayList<Float> getDegrees(ArgumentProblem argProblem,
                                   Solution solution,
                                   ArrayList<Position> allPositions,
                                   int index)
Return a list with the degrees (attack, efficiency, explanatory power, persuasiveness, support and risk) of an argument-case

Parameters:
argProblem - Problem to solve
solution - Solution that proposes the argument-case
allPositions - Positions to calculate the degrees of the argument-case
index - Index of the position that represents the argument-case which the degrees are being calculated
Returns:
list with the degrees

getAttackDegree

public ArrayList<Float> getAttackDegree(ArrayList<SimilarArgumentCase> sameProblemAcceptedArgCases,
                                        ArrayList<Position> initialPositions)
Returns the attack degree of each given Position

Parameters:
sameProblemAcceptedArgCases - argument-cases with the same problem description and that were accepted
initialPositions - ArrayList with different positions, but with the same problem description
Returns:
an ArrayList of Float with the attack degree of each initial position

getEfficiencyDegree

public ArrayList<Float> getEfficiencyDegree(ArrayList<SimilarArgumentCase> sameProblemAcceptedArgCases,
                                            ArrayList<Position> initialPositions)
Returns the efficiency degree of each initial position

Parameters:
sameProblemAcceptedArgCases - argument-cases with the same problem description and that were accepted
initialPositions - ArrayList with different positions, but with the same problem description
Returns:
an ArrayList of Float with the efficiency degree of each initial position

getExplanatoryPower

public ArrayList<Float> getExplanatoryPower(ArrayList<SimilarArgumentCase> sameProblemAcceptedArgCases,
                                            ArrayList<Position> initialPositions)
Returns the explanatory power of the given positions

Parameters:
sameProblemAcceptedArgCases - argument-cases with the same problem description and that were accepted
initialPositions - ArrayList with different positions, but with the same problem description
Returns:
an ArrayList of Float with the explanatory power of each initial position

getSameDomainAndSocialContextAccepted

public ArrayList<SimilarArgumentCase> getSameDomainAndSocialContextAccepted(HashMap<Integer,Premise> premises,
                                                                            Solution solution,
                                                                            SocialContext socialContext)
Returns the argument-cases with the same domain and social context that have been accepted in teh past

Parameters:
premises - HashMap of the premises that describe the domain context
solution - Solution of the problem
socialContext - SocialContext of the current situation
Returns:
argument-cases with the same domain and social context that have been accepted

getMostSimilarArgCases

public ArrayList<SimilarArgumentCase> getMostSimilarArgCases(ArgumentProblem argProblem)
Get the argument-cases with the same domain context as the given argument-case and the same dependency relation. The returned argument-cases are weighted with a degree of suitability that depends on the degree of similarity with the social context of the given argument-case

Parameters:
argProblem - The argument problem with a specific domain context and social context that the returned argument-cases have to be similar
Returns:
an ArrayList of SimilarArgumentCase that have the same domain context as the given argument-case and the same dependency relation, weighted with a suitability degree

getAllCases

public Collection<ArrayList<ArgumentCase>> getAllCases()
Returns all argument-cases in a Collection

Returns:
all argument-cases in a Collection

getAllCasesVector

public Vector<ArgumentCase> getAllCasesVector()
Returns all argument-cases in a Vector

Returns:
all argument-cases in a Vector

doCache

public void doCache()
Stores the argument-case case-base in the file path specified in the creation of the class


doCache

public void doCache(String fileName)
Stores the argument-case case-base in the file path specified as argument

Parameters:
fileName - File path to store the case-base

doCacheInc

public void doCacheInc()
Stores the argument-case case-base in the file path specified in the creation of the class, but keeping all previous information of that file



Copyright © 2012 GTI-IA. All Rights Reserved.