/* 
 *      //\\
 *    ////\\\\	  Project Bayanihan
 *   o |.[].|o 
 *  -->|....|->-  Worldwide Volunteer Computing Using Java
 *  o o.o.o.o\<\  
 * -->->->->->-   Copyright 1999, Luis F. G. Sarmenta.
 *   <\<\<\<\<\   All rights reserved.
 * 
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for NON-COMMERCIAL purposes and without
 * fee is hereby granted provided that this copyright notice
 * and disclaimer appear in all copies.
 *
 * LUIS F. G. SARMENTA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
 * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. LUIS F. G. SARMENTA
 * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
 * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 * ----------------------------------------------------------------------------|
 */
package bayanihan.apps.ftsim;

import java.util.*;
import bayanihan.util.*;
import bayanihan.api.mc.*;

public class SimRunWork2 extends SimRunWork
{  
   
   //////////////////
   // Constructors //
   //////////////////

   /**
    * Needed for HORB compatibility.
    */
   public SimRunWork2()
   {
   }

   ////////////////////
   // Initialization //
   ////////////////////

   
   /////////////////////////////////
   // Overridden abstract methods //
   /////////////////////////////////

   
   //////////////////////////////
   // methods used in doWork() //   
   //////////////////////////////

   /**
    * Hook used in createWorks to create WorkEntry.
    */
   protected WorkEntry _createWorkEntry()
   {
      if ( config.usingCred() )
      {
         
         if ( config.credVoting )
         {
            return new VotingCredWorkEntry2( config.cF, config.cH,
                                            config.cThresh );
         }
         else
         {
            return new CredWorkEntry( config.cF, config.cH,
                                      config.cThresh );
         }
      } 
      else
      {
         if ( config.r == 1 )
         {
            return new WorkEntry();
         }
         else
         {
            return new VotingWorkEntry( config.m, config.r );
         }
      }
   }

}


