public SpotOptionsRequest withAllocationStrategy(SpotAllocationStrategy allocationStrategy) {
        this.allocationStrategy = allocationStrategy.toString();
        return this;
    }
<p>
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools
specified by the EC2 Fleet launch configuration. For more information, see <a
href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html">Allocation
strategies for Spot Instances</a> in the <i>Amazon EC2 User Guide</i>.
</p>
<dl>
<dt>price-capacity-optimized (recommended)</dt>
<dd>
<p>
EC2 Fleet identifies the pools with the highest capacity availability for the number of instances that are
launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance
of interruption in the near term. EC2 Fleet then requests Spot Instances from the lowest priced of these pools.
</p>
</dd>
<dt>capacity-optimized</dt>
<dd>
<p>
EC2 Fleet identifies the pools with the highest capacity availability for the number of instances that are
launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance
of interruption in the near term. To give certain instance types a higher chance of launching first, use
<code>capacity-optimized-prioritized</code>. Set a priority for each instance type by using the
<code>Priority</code> parameter for <code>LaunchTemplateOverrides</code>. You can assign the same priority to
different <code>LaunchTemplateOverrides</code>. EC2 implements the priorities on a best-effort basis, but
optimizes for capacity first. <code>capacity-optimized-prioritized</code> is supported only if your EC2 Fleet
uses a launch template. Note that if the On-Demand <code>AllocationStrategy</code> is set to
<code>prioritized</code>, the same priority is applied when fulfilling On-Demand capacity.
</p>
</dd>
<dt>diversified</dt>
<dd>
<p>
EC2 Fleet requests instances from all of the Spot Instance pools that you specify.
</p>
</dd>
<dt>lowest-price (not recommended)</dt>
<dd><important>
<p>
We don't recommend the <code>lowest-price</code> allocation strategy because it has the highest risk of
interruption for your Spot Instances.
</p>
</important>
<p>
EC2 Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest
priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has
available capacity. If a pool runs out of capacity before fulfilling your desired capacity, EC2 Fleet will
continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired
capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers
instance price and not capacity availability, it might lead to high interruption rates.
</p>
</dd>
</dl>
<p>
Default: <code>lowest-price</code>
</p>

@param allocationStrategy
       The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance
       pools specified by the EC2 Fleet launch configuration. For more information, see <a
       href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html">Allocation
       strategies for Spot Instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
       <dl>
       <dt>price-capacity-optimized (recommended)</dt>
       <dd>
       <p>
       EC2 Fleet identifies the pools with the highest capacity availability for the number of instances that are
       launching. This means that we will request Spot Instances from the pools that we believe have the lowest
       chance of interruption in the near term. EC2 Fleet then requests Spot Instances from the lowest priced of
       these pools.
       </p>
       </dd>
       <dt>capacity-optimized</dt>
       <dd>
       <p>
       EC2 Fleet identifies the pools with the highest capacity availability for the number of instances that are
       launching. This means that we will request Spot Instances from the pools that we believe have the lowest
       chance of interruption in the near term. To give certain instance types a higher chance of launching
       first, use <code>capacity-optimized-prioritized</code>. Set a priority for each instance type by using the
       <code>Priority</code> parameter for <code>LaunchTemplateOverrides</code>. You can assign the same priority
       to different <code>LaunchTemplateOverrides</code>. EC2 implements the priorities on a best-effort basis,
       but optimizes for capacity first. <code>capacity-optimized-prioritized</code> is supported only if your
       EC2 Fleet uses a launch template. Note that if the On-Demand <code>AllocationStrategy</code> is set to
       <code>prioritized</code>, the same priority is applied when fulfilling On-Demand capacity.
       </p>
       </dd>
       <dt>diversified</dt>
       <dd>
       <p>
       EC2 Fleet requests instances from all of the Spot Instance pools that you specify.
       </p>
       </dd>
       <dt>lowest-price (not recommended)</dt>
       <dd><important>
       <p>
       We don't recommend the <code>lowest-price</code> allocation strategy because it has the highest risk of
       interruption for your Spot Instances.
       </p>
       </important>
       <p>
       EC2 Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the
       lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced
       pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity,
       EC2 Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure
       that your desired capacity is met, you might receive Spot Instances from several pools. Because this
       strategy only considers instance price and not capacity availability, it might lead to high interruption
       rates.
       </p>
       </dd>
       </dl>
       <p>
       Default: <code>lowest-price</code>
@return Returns a reference to this object so that method calls can be chained together.
@see SpotAllocationStrategy
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/SpotOptionsRequest.java