Package csa.jportal.ai.enhancedAI

Examples of csa.jportal.ai.enhancedAI.EAIConfigurationData


                {
                    MatchComputerPlayer cp = (MatchComputerPlayer) mPlayers[0];
                    AIPlayer aip = cp.getAIPlayer();
                    if (!aip.isScriptedAI())
                    {
                        EAIConfigurationData eaiConfig = aip.getEAIConfig();
                        if (eaiConfig != null)
                        {
                            String wName = eaiConfig.getActiveWeightingCollection();
                            weightingUsed = Weighting.buildWeighting(wName);
                        }
                    }
                }
            }
            else // if(mPlayerTurn == 1)
            {
                if (mPlayers[1] instanceof MatchComputerPlayer)
                {
                    MatchComputerPlayer cp = (MatchComputerPlayer) mPlayers[1];
                    AIPlayer aip = cp.getAIPlayer();
                    if (!aip.isScriptedAI())
                    {
                        EAIConfigurationData eaiConfig = aip.getEAIConfig();
                        if (eaiConfig != null)
                        {
                            String wName = eaiConfig.getActiveWeightingCollection();
                            weightingUsed = Weighting.buildWeighting(wName);
                        }
                    }
                }
            }
View Full Code Here


                {
                    MatchComputerPlayer cp = (MatchComputerPlayer) mPlayers[0];
                    AIPlayer aip = cp.getAIPlayer();
                    if (!aip.isScriptedAI())
                    {
                        EAIConfigurationData eaiConfig = aip.getEAIConfig();
                        if (eaiConfig != null)
                        {
                            String wName = eaiConfig.getActiveWeightingCollection();
                            weightingUsed = Weighting.buildWeighting(wName);
                        }
                    }
                }
            }
            else // if(mPlayerTurn == 1)
            {
                if (mPlayers[1] instanceof MatchComputerPlayer)
                {
                    MatchComputerPlayer cp = (MatchComputerPlayer) mPlayers[1];
                    AIPlayer aip = cp.getAIPlayer();
                    if (!aip.isScriptedAI())
                    {
                        EAIConfigurationData eaiConfig = aip.getEAIConfig();
                        if (eaiConfig != null)
                        {
                            String wName = eaiConfig.getActiveWeightingCollection();
                            weightingUsed = Weighting.buildWeighting(wName);
                        }
                    }
                }
            }
View Full Code Here

        String klasse = jTextFieldKlasse.getText();
        String name = mAIPlayer.getData().mName;
        resetConfigPool(true, klasse, name);
        if (!mAIPlayer.isScriptedAI())
        {
            EAIConfigurationData eaiConfig = mAIPlayer.getEAIConfig();
            jComboBoxScoringCollectionActive.setSelectedItem(eaiConfig.getActiveWeightingCollection());
        }
        //jComboBoxName.setSelectedItem(name);
        csa.jportal.config.Configuration.getConfiguration().resetScriptCaching();
        mClassSetting--;
}//GEN-LAST:event_jButtonSaveActionPerformed
View Full Code Here

        jCheckBox4.setSelected(false);

        if (!mAIPlayer.isScriptedAI())
        {
            EAIConfigurationData eaiConfig = mAIPlayer.getEAIConfig();
            if (eaiConfig == null) eaiConfig = new EAIConfigurationData();
            {
                int i = eaiConfig.getMaxEaiDepth();
                if (i != -1)
                   jComboBox6.setSelectedItem(EAIConstants.EAI_SIM_DEPTH_STRINGS[i]);
            }
            jTextField2.setText(""+eaiConfig.getMaxEAIWidth());
            jTextField3.setText(""+eaiConfig.getReduceLibrarySearch());
            jTextFieldReduceX.setText(""+eaiConfig.getreduceXCountToMax());
            jTextFieldSingleTargetReduction.setText(""+ eaiConfig.getreduceSingleTargetPermutation());
            jCheckBoxOOMPrevention.setSelected(eaiConfig.getInternalOOMPrevention());
            jTextFieldAttackThreshold.setText(""+ eaiConfig.getSavetyHealthThreshold());
           
            jCheckBox4.setSelected(eaiConfig.getLandForceMain1());
            jCheckBoxLeafScoring.setSelected(eaiConfig.getOnlyLeafScoring());
            jCheckBoxAdaptiveBlocking.setSelected(eaiConfig.getOpponentAdaptiveBlocking());
            jCheckBoxcombatEvalCache.setSelected(eaiConfig.getEnableCombatCaching());
            jCheckBoxExperimentActive.setSelected(eaiConfig.getEnableAttackPreCombatScoring());

            jCheckBoxAttackDecrease.setSelected(eaiConfig.getAttackDecrease());
            jCheckBoxAttackIncrease.setSelected(eaiConfig.getAttackIncrease());
            jCheckBoxPower.setSelected(eaiConfig.getAttackByPower());
            jCheckBoxToughness.setSelected(eaiConfig.getAttackByToughness());
            jTextFieldAttackStep.setText(""+eaiConfig.getAttackStepCount());
           
            jTextFieldAdjustment.setText(""+eaiConfig.getEAIAdjustmentBorder());
           
            jCheckBoxSimpleBlock.setSelected(eaiConfig.getTrySimpleBLock());
            jCheckBoxSimpleAttack.setSelected(eaiConfig.getTrySimpleAttack());
            jCheckBoxExtremeTesting.setSelected(eaiConfig.getTryExtremeTesting());
            jCheckBoxReducedActivation.setSelected(eaiConfig.getReducedActivationEvaluation());
            jCheckBoxScoringInBlocking.setSelected(eaiConfig.getUseScoringInBlockEvaluation());
            jCheckBox6.setSelected(eaiConfig.getDontDamageOwn());

            jCheckBoxFullBlockerlist.setSelected(eaiConfig.getOnlyFullBlockerList());
            jCheckBoxBlockDefOrder.setSelected(eaiConfig.getBlockerInDefensiveOrder());
            jCheckBoxRemoveNonEffectiveBlockers.setSelected(eaiConfig.getRemoveNonEffectiveBlockers());
            jCheckBoxUnblockableAttackers.setSelected(eaiConfig.getRemoveUnblockableAttackers());
            jCheckBoxRemoveUnblockableBlockers.setSelected(eaiConfig.getRemoveUnblockableBlockers());

            jCheckBox7.setSelected(eaiConfig.getMaximizeTargetSelection());
            jCheckBox8.setSelected(eaiConfig.getDoAttackOnNoBlocker());
            jCheckBox9.setSelected(eaiConfig.getDoQuickReblockAnalyze());

            jComboBoxOpponentBlockStrategy.setSelectedIndex(eaiConfig.getOpponentBlockStrategy());           
           
            jComboBoxOpponentBlockStrategy.setEnabled(!jCheckBoxAdaptiveBlocking.isSelected());

            jComboBoxScoringCollectionActive.setSelectedItem(eaiConfig.getActiveWeightingCollection());
            /*
            if (eaiConfig.getActiveWeightingCollection().equals("REAL_INTERNAL"))
            {
                jComboBoxScoringCollectionActive.setSelectedIndex(-1);
                jCheckBox5.setSelected(true);
View Full Code Here

        mAIPlayer.getData().mInternalAI = jCheckBoxInternalAI.isSelected();
        mAIPlayer.getData().mClassName = jTextField1.getText();

        if (!mAIPlayer.isScriptedAI())
        {
            EAIConfigurationData eaiConfig = mAIPlayer.getEAIConfig();
            if (eaiConfig == null) eaiConfig = new EAIConfigurationData();
            mAIPlayer.setEAIConfig(eaiConfig);
            eaiConfig.mName = mAIPlayer.getData().mName;
            if (jComboBox6.getSelectedIndex() == -1) // default...
                eaiConfig.setMaxEaiDepth(EAIConstants.EAI_SIM_DEPTH_BLOCK_OF_OPPONENTS_ATTACK);
            else
            {
                int s = jComboBox6.getSelectedIndex();
                eaiConfig.setMaxEaiDepth(s);
            }
            String s = jTextField2.getText();
            int ss = csa.util.UtilityString.IntX(s, 5);
            eaiConfig.setMaxEAIWidth(ss);

            s = jTextField3.getText();
            ss = csa.util.UtilityString.IntX(s, 5);
           
           
            eaiConfig.setAttackDecrease(jCheckBoxAttackDecrease.isSelected());
            eaiConfig.setAttackIncrease(jCheckBoxAttackIncrease.isSelected());
            eaiConfig.setAttackByPower(jCheckBoxPower.isSelected());
            eaiConfig.setAttackByToughness(jCheckBoxToughness.isSelected());
            eaiConfig.setAttackStepCount(csa.util.UtilityString.IntX(jTextFieldAttackStep.getText(),0));
            eaiConfig.setreduceXCountToMax(csa.util.UtilityString.IntX(jTextFieldReduceX.getText(),0));

            eaiConfig.setInternalOOMPrevention(jCheckBoxOOMPrevention.isSelected());
            eaiConfig.setSavetyHealthThreshold(csa.util.UtilityString.IntX(jTextFieldAttackThreshold.getText(),0));
           
            eaiConfig.setReduceLibrarySearch(ss);
            eaiConfig.setLandForceMain1(jCheckBox4.isSelected());
            eaiConfig.setOnlyLeafScoring(jCheckBoxLeafScoring.isSelected());

            eaiConfig.setEAIAdjustmentBorder(csa.util.UtilityString.IntX(jTextFieldAdjustment.getText(),0));

            eaiConfig.setreduceSingleTargetPermutation(csa.util.UtilityString.IntX(jTextFieldSingleTargetReduction.getText(),0));
            eaiConfig.setOpponentAdaptiveBlocking(jCheckBoxAdaptiveBlocking.isSelected());
            eaiConfig.setOpponentBlockStrategy(jComboBoxOpponentBlockStrategy.getSelectedIndex());
            eaiConfig.setDontDamageOwn(jCheckBox6.isSelected());

            eaiConfig.setEnableCombatCaching(jCheckBoxcombatEvalCache.isSelected());
            eaiConfig.setEnableAttackPreCombatScoring(jCheckBoxExperimentActive.isSelected());
           
           
            eaiConfig.setTrySimpleBLock(jCheckBoxSimpleBlock.isSelected());
            eaiConfig.setTrySimpleAttack(jCheckBoxSimpleAttack.isSelected());
            eaiConfig.setTryExtremeTesting(jCheckBoxExtremeTesting.isSelected());
            eaiConfig.setUseScoringInBlockEvaluation(jCheckBoxScoringInBlocking.isSelected());
            eaiConfig.setReducedActivationEvaluation(jCheckBoxReducedActivation.isSelected());

            eaiConfig.setMaximizeTargetSelection(jCheckBox7.isSelected());
            eaiConfig.setDoAttackOnNoBlocker(jCheckBox8.isSelected());
            eaiConfig.setDoQuickReblockAnalyze(jCheckBox9.isSelected());

            eaiConfig.setOnlyFullBlockerList(jCheckBoxFullBlockerlist.isSelected());
            eaiConfig.setBlockerInDefensiveOrder(jCheckBoxBlockDefOrder.isSelected());
            eaiConfig.setRemoveNonEffectiveBlockers(jCheckBoxRemoveNonEffectiveBlockers.isSelected());
            eaiConfig.setRemoveUnblockableAttackers(jCheckBoxUnblockableAttackers.isSelected());
            eaiConfig.setRemoveUnblockableBlockers(jCheckBoxRemoveUnblockableBlockers.isSelected());

            if (jComboBoxScoringCollectionActive.getSelectedIndex() != -1)
                eaiConfig.setActiveWeightingCollection(jComboBoxScoringCollectionActive.getSelectedItem().toString());
/*
            if (jCheckBox5.isSelected())
            {
                eaiConfig.setActiveWeightingCollection("REAL_INTERNAL");
            }
View Full Code Here

            if (eaiConfig != null) return eaiConfig;
            EAIConfigurationDataPool eAIConfigurationDataPool = new EAIConfigurationDataPool();
            eaiConfig = eAIConfigurationDataPool.get(mAIPlayerData.mName);
            if (eaiConfig == null) // new AI
            {
                eaiConfig = new EAIConfigurationData();
            }
            activeWeighting = Weighting.buildWeighting(eaiConfig.getActiveWeightingCollection());
        }
        return eaiConfig;
    }
View Full Code Here

TOP

Related Classes of csa.jportal.ai.enhancedAI.EAIConfigurationData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.