/*******************************************************************************
* Copyright (c) 2010-2016, Andras Szabolcs Nagy, Zoltan Ujhelyi and Daniel Varro
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-v20.html.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.viatra.dse.api.strategy.impl;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.log4j.Logger;
import org.eclipse.viatra.dse.api.DSEException;
import org.eclipse.viatra.dse.api.strategy.interfaces.IStrategy;
import org.eclipse.viatra.dse.base.ThreadContext;
import org.eclipse.viatra.dse.objectives.Fitness;
import org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRule;
import com.google.common.collect.Lists;
/**
* Works as {@link DepthFirstStrategy} but:
*
*
works only with single thread,
*
in a given state, it only traverses the activations with locally the highest priority.
*
*
* @author Andras Szabolcs Nagy
*
*/
public class FixedPriorityStrategy implements IStrategy {
private int maxDepth = Integer.MAX_VALUE;
private AtomicBoolean isInterrupted = new AtomicBoolean(false);
private ThreadContext context;
private Logger logger = Logger.getLogger(IStrategy.class);
private Map, Integer> priorities = new HashMap, Integer>();
private Random random = new Random();
private Map