public int IndexOfElement(DomainElement de)
        {
            var tmpTotalCardinality = 1;
            var numberOfSteps       = 0;

            for (var i = _simpleDomains.Length - 1; i >= 0; i--)
            {
                var currentDomainElementValue = de.GetComponentValue(i);

                var index = currentDomainElementValue - _simpleDomains[i].GetFirst();

                numberOfSteps       += index * tmpTotalCardinality;
                tmpTotalCardinality *= _simpleDomains[i].GetCardinality();
            }
            return(numberOfSteps);
        }
Exemplo n.º 2
0
 public int IndexOfElement(DomainElement de)
 {
     return(de.GetComponentValue(0) - _first);
 }