@@ -0,0 +1,1680 @@
+/*%0A * Copyright 2016 Will Knez %3Cwbknez.dev@gmail.com%3E%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.solsticesquared.schelling.dynamics;%0A%0Aimport com.solsticesquared.schelling.move.MovementMethod;%0Aimport com.solsticesquared.schelling.move.SwapMovementMethod;%0A%0A/**%0A * Represents an implementation of %7B@link SimulationDynamics%7D that describes%0A * a simulation where %22unhappy%22 agents swap locations directly.%0A *%0A * %3Cp%3E%0A *     This dynamics of this variation of the traditional Schelling model have%0A *     the following rules:%0A *     %3Col%3E%0A *         %3Cli%3EThere are no empty cells.%3C/li%3E%0A *         %3Cli%3EThere is no relocation of %22happy%22 agents (it does not make%0A *         sense).%3C/li%3E%0A *         %3Cli%3E%22Unhappy%22 agents exchange places with each other (at random)%0A *         .%3C/li%3E%0A *     %3C/ol%3E%0A * %3C/p%3E%0A */%0Apublic class SwapSimulationDynamics implements SimulationDynamics %7B%0A%0A    @Override%0A    public boolean allowsEmptyCells() %7B%0A        return false;%0A    %7D%0A%0A    @Override%0A    public boolean allowsHappyAgentRelocation() %7B%0A        return false;%0A    %7D%0A%0A    @Override%0A    public MovementMethod getMovementMethod() %7B%0A        return new SwapMovementMethod();%0A    %7D%0A%7D%0A

Add swap-based simulation dynamics.