/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package etomica.potential;

import etomica.space.Space;

/**
 * Factory that makes truncated and switched potentials.
 */
public class TruncationFactorySwitch implements TruncationFactory {

    protected final Space space;
    protected final double rc;

    public TruncationFactorySwitch(Space space, double rc) {
        this.space = space;
        this.rc = rc;
    }

    @Override
    public Potential2Soft make(Potential2SoftSpherical... p2) {
        return new P2SoftSphericalSumTruncatedSwitched(space, rc, p2);
    }
}

@@ -452,16 +452,54 @@
 uble rc;
+%0A    protected final double switchFac;
 %0A%0A    pu
@@ -569,92 +569,266 @@
 this
-.space = space;%0A        this.rc = rc;%0A    %7D%0A%0A    @Override%0A    public Potential2Soft
+(space, rc, 0.95);%0A    %7D%0A%0A    public TruncationFactorySwitch(Space space, double rc, double switchFac) %7B%0A        this.space = space;%0A        this.rc = rc;%0A        this.switchFac = switchFac;%0A    %7D%0A%0A    @Override%0A    public P2SoftSphericalSumTruncatedSwitched
  mak
@@ -874,14 +874,52 @@
     
-return
+P2SoftSphericalSumTruncatedSwitched pTrunc =
  new
@@ -971,16 +971,79 @@
 c, p2);%0A
+        pTrunc.setSwitchFac(switchFac);%0A        return pTrunc;%0A
     %7D%0A%7D%0A

make switchFac a factory parameter