source: cpp/frams/model/similarity/simil_match.h @ 872

Last change on this file since 872 was 869, checked in by Maciej Komosinski, 5 years ago

Added another, improved way of calculating dissimilarity of two creatures/models. Details and comparisons in https://doi.org/10.1007/978-3-030-16692-2_8

  • 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-2019  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.