Examples of GenuineVariableDescriptor


Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

    }

    @Test
    public void multiVariable() {
        EntityDescriptor entityDescriptor = TestdataMultiVarEntity.buildEntityDescriptor();
        GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor("secondaryValue");
        TestdataMultiVarEntity e1 = new TestdataMultiVarEntity("e1");
        TestdataMultiVarEntity e2 = new TestdataMultiVarEntity("e2");
        TestdataValue p1 = new TestdataValue("p1");
        TestdataValue s1 = new TestdataValue("s1");
        TestdataValue s2 = new TestdataValue("s2");
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

    // Cache lifecycle methods
    // ************************************************************************

    public void constructCache(DefaultSolverScope solverScope) {
        InnerScoreDirector scoreDirector = solverScope.getScoreDirector();
        GenuineVariableDescriptor variableDescriptor = valueSelector.getVariableDescriptor();
        Class<?> entityClass = variableDescriptor.getEntityDescriptor().getEntityClass();
        long valueSize = valueSelector.getSize();
        // Fail-fast when anchorTrailingChainList.size() could ever be too big
        if (valueSize > (long) Integer.MAX_VALUE) {
            throw new IllegalStateException("The selector (" + this
                    + ") has a valueSelector (" + valueSelector
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

    public PillarChangeMoveSelector(PillarSelector pillarSelector, ValueSelector valueSelector,
            boolean randomSelection) {
        this.pillarSelector = pillarSelector;
        this.valueSelector = valueSelector;
        this.randomSelection = randomSelection;
        GenuineVariableDescriptor variableDescriptor = valueSelector.getVariableDescriptor();
        if (variableDescriptor.isChained()) {
            throw new IllegalStateException("The selector (" + this
                    + ") has a variableDescriptor (" + variableDescriptor
                    + ") which is chained (" + variableDescriptor.isChained() + ").");
        }
        phaseLifecycleSupport.addEventListener(pillarSelector);
        phaseLifecycleSupport.addEventListener(valueSelector);
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

     */
    public ValueSelector buildValueSelector(HeuristicConfigPolicy configPolicy,
            EntityDescriptor entityDescriptor,
            SelectionCacheType minimumCacheType, SelectionOrder inheritedSelectionOrder) {
        entityDescriptor = downcastEntityDescriptor(configPolicy, entityDescriptor);
        GenuineVariableDescriptor variableDescriptor = deduceVariableDescriptor(entityDescriptor, variableName);
        SelectionCacheType resolvedCacheType = SelectionCacheType.resolve(cacheType, minimumCacheType);
        SelectionOrder resolvedSelectionOrder = SelectionOrder.resolve(selectionOrder,
                inheritedSelectionOrder);

        if (nearbySelectionConfig != null) {
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

    private ValueSelector applySorting(SelectionCacheType resolvedCacheType, SelectionOrder resolvedSelectionOrder,
            ValueSelector valueSelector) {
        if (resolvedSelectionOrder == SelectionOrder.SORTED) {
            SelectionSorter sorter;
            if (sorterManner != null) {
                GenuineVariableDescriptor variableDescriptor = valueSelector.getVariableDescriptor();
                if (!sorterManner.hasSorter(variableDescriptor)) {
                    return valueSelector;
                }
                sorter = sorterManner.determineSorter(variableDescriptor);
            } else if (sorterComparatorClass != null) {
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

                                + ") has a " + variableAnnotationClass.getSimpleName()
                                + " annotated property (" + propertyDescriptor.getName()
                                + ") that should have a setter.");
                    }
                    if (variableAnnotationClass.equals(PlanningVariable.class)) {
                        GenuineVariableDescriptor variableDescriptor = new GenuineVariableDescriptor(
                                this, propertyDescriptor);
                        declaredGenuineVariableDescriptorMap.put(propertyDescriptor.getName(), variableDescriptor);
                        variableDescriptor.processAnnotations(descriptorPolicy);
                    } else if (variableAnnotationClass.equals(InverseRelationShadowVariable.class)) {
                        ShadowVariableDescriptor variableDescriptor = new InverseRelationShadowVariableDescriptor(
                                this, propertyDescriptor);
                        declaredShadowVariableDescriptorMap.put(propertyDescriptor.getName(), variableDescriptor);
                        variableDescriptor.processAnnotations(descriptorPolicy);
                    } else if (variableAnnotationClass.equals(CustomShadowVariable.class)) {
                        ShadowVariableDescriptor variableDescriptor = new CustomShadowVariableDescriptor(
                                this, propertyDescriptor);
                        declaredShadowVariableDescriptorMap.put(propertyDescriptor.getName(), variableDescriptor);
                        variableDescriptor.processAnnotations(descriptorPolicy);
                    } else {
                        throw new IllegalStateException("The variableAnnotationClass ("
                                + variableAnnotationClass + ") is not implemented.");
                    }
                }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

public class ChainedChangeMoveTest {

    @Test
    public void noTrailing() {
        EntityDescriptor entityDescriptor = TestdataChainedEntity.buildEntityDescriptor();
        GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor("chainedObject");
        InnerScoreDirector scoreDirector = mock(InnerScoreDirector.class);

        TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
        TestdataChainedEntity a1 = new TestdataChainedEntity("a1", a0);
        TestdataChainedEntity a2 = new TestdataChainedEntity("a2", a1);
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

    }

    @Test
    public void oldAndNewTrailing() {
        EntityDescriptor entityDescriptor = TestdataChainedEntity.buildEntityDescriptor();
        GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor("chainedObject");
        InnerScoreDirector scoreDirector = mock(InnerScoreDirector.class);

        TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
        TestdataChainedEntity a1 = new TestdataChainedEntity("a1", a0);
        TestdataChainedEntity a2 = new TestdataChainedEntity("a2", a1);
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

public class SubChainReversingSwapMoveTest {

    @Test
    public void noTrailing() {
        EntityDescriptor entityDescriptor = TestdataChainedEntity.buildEntityDescriptor();
        GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor("chainedObject");
        InnerScoreDirector scoreDirector = mock(InnerScoreDirector.class);

        TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
        TestdataChainedEntity a1 = new TestdataChainedEntity("a1", a0);
        TestdataChainedEntity a2 = new TestdataChainedEntity("a2", a1);
View Full Code Here

Examples of org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor

    }

    @Test
    public void noTrailingInPlace() {
        EntityDescriptor entityDescriptor = TestdataChainedEntity.buildEntityDescriptor();
        GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor("chainedObject");
        InnerScoreDirector scoreDirector = mock(InnerScoreDirector.class);

        TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
        TestdataChainedEntity a1 = new TestdataChainedEntity("a1", a0);
        TestdataChainedEntity a2 = new TestdataChainedEntity("a2", a1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.