source: cpp/frams/model/similarity/simil-match.h @ 1249

Last change on this file since 1249 was 1044, checked in by oriona, 4 years ago

Similarity measures code refactored. Distribution-based similarity measure added.

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
4
5#ifndef SIMILMATCHING_H
6#define SIMILMATCHING_H
7
8#include <vector>
9
10/** This class describes a mutually single-valued function between two sets of elements
11        (these sets are called objects). These sets may have different sizes, so this function
12        is mutually single-valued only for some subset of the bigger set.
13        This class is used while building a matching function between Parts of two Framsticks'
14        organisms (similarity measure computation).
15 */
16class SimilMatching
17{
18protected:
19        /** Array of pointers to two vectors. Each one stores indices of matched elements of
20                the other object. Value <0 means that an element is not matched yet. Sizes of these
21                vectors are sizes of objects themselves.
22         */
23        std::vector<int> *m_apvMatched[2];
24public:
25        SimilMatching(int Obj0Size, int Obj1Size);
26        SimilMatching(const SimilMatching &Source);
27        ~SimilMatching();
28        int getObjectSize(int Obj);
29        void match(int Obj0, int Index0, int Obj1, int Index1);
30        bool isMatched(int Obj, int Index);
31        int getMatchedIndex(int Obj, int index);
32        bool isFull();
33        bool isEmpty();
34        void empty();
35        void printMatching();
36};
37
38#endif
Note: See TracBrowser for help on using the repository browser.