001/** 002 * MoreLikeThis.java 003 * jCOLIBRI2 framework. 004 * @author Juan A. Recio-Garc�a. 005 * GAIA - Group for Artificial Intelligence Applications 006 * http://gaia.fdi.ucm.es 007 * 02/11/2007 008 */ 009package es.ucm.fdi.gaia.jcolibri.extensions.recommendation.navigationByProposing.queryElicitation; 010 011 012import java.util.Collection; 013 014import es.ucm.fdi.gaia.jcolibri.cbrcore.CBRCase; 015import es.ucm.fdi.gaia.jcolibri.cbrcore.CBRQuery; 016import es.ucm.fdi.gaia.jcolibri.cbrcore.CaseComponent; 017import es.ucm.fdi.gaia.jcolibri.util.CopyUtils; 018 019/** 020 * Replaces current query with the description of the selected case. 021 * <p>See: 022 * <p>L. McGinty and B. Smyth. Comparison-based recommendation. In ECCBR'02: 023 * Proceedings of the 6th European Conference on Advances in Case-Based 024 * Reasoning, pages 575-589, London, UK, 2002. Springer-Verlag. 025 * 026 * @author Juan A. Recio-Garcia 027 * @author Developed at University College Cork (Ireland) in collaboration with Derek Bridge. 028 * @version 1.0 029 * 030 */ 031public class MoreLikeThis implements ComparisonQueryElicitation 032{ 033 034 /******************************************************************************/ 035 /** STATIC METHODS **/ 036 /******************************************************************************/ 037 038 /** 039 * Replaces current query with the description of the selected case. 040 */ 041 public static void moreLikeThis(CBRQuery query, CBRCase selectedCase) 042 { 043 CaseComponent cc = CopyUtils.copyCaseComponent(selectedCase.getDescription()); 044 query.setDescription(cc); 045 } 046 047 /******************************************************************************/ 048 /** OBJECT METHODS **/ 049 /******************************************************************************/ 050 051 052 /** 053 * Replaces current query with the description of the selected case. 054 */ 055 public void reviseQuery(CBRQuery query, CBRCase selectedCase, Collection<CBRCase> proposedCases) 056 { 057 moreLikeThis(query, selectedCase); 058 } 059}