/*
 * PoolAgent.java
 *
 * Created on November 29, 2004, 4:53 PM
 */

package DDMT.PoolAgent;

import jade.core.Agent;
import com.heaton.threads.ThreadPool;
import com.heaton.threads.TestEvent;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;
import jade.core.AID;
import jade.core.behaviours.*;
import java.lang.String;
import javax.swing.*;
import jade.domain.FIPAAgentManagement.*;
import jade.domain.*;
import java.lang.Integer;
import java.sql.*;
import java.util.Random;
import DDMT.templates.P2PKMeans.P2PKMeansNodeDefinition;

/**
 *
 * @author  John Kloetzli
 */
public class PoolAgent extends Agent{
    
    private ThreadPool threadPool;
    
    /** Creates a new instance of PoolAgent */
    public void setup() {
        
        //Set up the ThreadPool
        threadPool = new ThreadPool(3);

        for( int i = 0; i< 10; i++)
        {
            //Add EventsDefinition class
            P2PKMeansNodeDefinition ED = new P2PKMeansNodeDefinition();
        
            //Put it on the threadpool
            threadPool.assign(ED.ProcessMessage());
        }
    }
}
