Check the modifiers for the SARL agents.

@param agent the agent.
545654
@Check
	protected void checkModifiers(SarlAgent agent) {
		this.agentModifierValidator.checkModifiers(agent,
				MessageFormat.format(Messages.SARLValidator_9, agent.getName()));
	}
56946
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			getSarlAction().getModifiers().add(modifier);
		}
	}
246613
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlAnnotationType.getModifiers().add(modifier);
		}
	}
206202
function enableAgent(name) {
        if (agents.hasOwnProperty(name) && !_enabledAgentNames.hasOwnProperty(name)) {
            _enabledAgentNames[name] = true;
        }
    }
934390
def check_agent(options, cfg)
      identity = options[:identity]
      agent_type = options[:agent_type]
      type = AgentIdentity.parse(identity).agent_type if identity
      fail("Agent type #{agent_type.inspect} and identity #{identity.inspect} are inconsistent") if agent_type != type
      fail("Cannot find agent init.rb file in init directory of #{AgentConfig.root_dir.inspect}") unless AgentConfig.init_file

      actors = cfg[:actors]
      fail('Agent configuration is missing actors') unless actors && actors.respond_to?(:each)
      actors_dirs = AgentConfig.actors_dirs
      actors.each do |a|
        found = false
        actors_dirs.each { |d| break if (found = File.exist?(File.normalize_path(File.join(d, "#{a}.rb")))) }
        fail("Cannot find source for actor #{a.inspect} in #{actors_dirs.inspect}") unless found
      end
      true
    end
690913
public static void checkMethodModifiers(final int modifiers) {

        // Base check
        checkModifiers(METHOD, modifiers);

        // Check overlapping modifiers
        if (Modifier.isPrivate(modifiers)) {
            if (Modifier.isProtected(modifiers) || Modifier.isPublic(modifiers)) {
                throw new IllegalArgumentException(METHOD_ACCESS_MODIFIER_ERROR + " ["
                        + Modifier.toString(modifiers) + "]");
            }
        }
        if (Modifier.isProtected(modifiers)) {
            if (Modifier.isPrivate(modifiers) || Modifier.isPublic(modifiers)) {
                throw new IllegalArgumentException(METHOD_ACCESS_MODIFIER_ERROR + " ["
                        + Modifier.toString(modifiers) + "]");
            }
        }
        if (Modifier.isPublic(modifiers)) {
            if (Modifier.isPrivate(modifiers) || Modifier.isProtected(modifiers)) {
                throw new IllegalArgumentException(METHOD_ACCESS_MODIFIER_ERROR + " ["
                        + Modifier.toString(modifiers) + "]");
            }
        }

        // Check illegal abstract modifiers
        if (Modifier.isAbstract(modifiers)) {
            if (Modifier.isPrivate(modifiers) || Modifier.isStatic(modifiers)
                    || Modifier.isFinal(modifiers) || Modifier.isNative(modifiers)
                    || Modifier.isStrict(modifiers) || Modifier.isSynchronized(modifiers)) {
                throw new IllegalArgumentException(METHOD_ILLEGAL_ABSTRACT_MODIFIERS_ERROR + " ["
                        + Modifier.toString(modifiers) + "]");
            }
        }

        // Check native and strictfp
        if (Modifier.isNative(modifiers) && Modifier.isStrict(modifiers)) {
            throw new IllegalArgumentException(METHOD_NATIVE_STRICTFP_ERROR + " ["
                    + Modifier.toString(modifiers) + "]");
        }

    }
393190
@Override
    public boolean simpleEvaluation(Agent currentAgent) {
        Agent agent = currentAgent;
        if (bodyId != null) {
            agent = agent.getAgentsAppState().getAgent(bodyId);
        }
        if (agent instanceof HumanAgent) {
            DiseaseManager dm = ((HumanAgent)agent).getDiseaseManager();
            if (dm != null) {
                Symptom s = dm.getSymptom(symptomName);
                if (s != null) {
                    if (s.getCurrentLevel().equals(Symptom.Level.valueOf(symptomLevel))) {
                        return true;
                    }
                } else {
                    logger.log(Level.WARNING, "Agent {0} hasn't got symptom {1}!", new Object[]{agent.getId(), symptomName});
                    return symptomLevel.equals(Symptom.Level.NONE.name());
                }
            } else {
                logger.log(Level.WARNING, "Agent {0} hasn't got DiseaseManager", new Object[]{agent.getId()});
                return symptomLevel.equals(Symptom.Level.NONE.name());
            }
        }

        return false;
    }
1164085
public void setAgentNetworkInfoList(java.util.Collection<AgentNetworkInfo> agentNetworkInfoList) {
        if (agentNetworkInfoList == null) {
            this.agentNetworkInfoList = null;
            return;
        }

        this.agentNetworkInfoList = new java.util.ArrayList<AgentNetworkInfo>(agentNetworkInfoList);
    }
450486
def applies_to (self, useragent):
        
        if not useragent:
            return True
        useragent = useragent.lower()
        for agent in self.useragents:
            if agent == '*':
                # we have the catch-all agent
                return True
            if agent.lower() in useragent:
                return True
        return False
1288472
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlEvent.getModifiers().add(modifier);
		}
	}
18598
def agent_version(self, value):
        
        if value == self._defaults['ai.internal.agentVersion'] and 'ai.internal.agentVersion' in self._values:
            del self._values['ai.internal.agentVersion']
        else:
            self._values['ai.internal.agentVersion'] = value
440487
public static void applyUserAgent(String agent) {
    LOGGER.info("Applying agent: " + agent);
    System.setProperty("http.agent", agent);
    System.setProperty("https.agent", agent);
  }
1305781
public boolean isValidUserAgent(final String agent) {
        if (!validateUserAgent) {
            return true;
        }
        final Matcher matcher = AGENT_PATTERN.matcher(agent);
        return matcher.matches();
    }
890540
public static Automaton getDeepestAutomaton(Agent agent) {
        Automaton a1 = agent.getAutomaton();
        Automaton a2 = agent.getAutomaton().currentState;
        while (a2 != null || !(a2 instanceof SimpleState)) {
            a1 = a2;
            a2 = a2.currentState;

        }
        return a1;

    }
1198564
@Check
	public void checkSuperConstructor(SarlAgent agent) {
		checkSuperConstructor(
				agent,
				XTEND_TYPE_DECLARATION__NAME,
				doGetConstructorParameterTypes(Agent.class, agent));
	}
744546
public static void agentmain(String agentArgs, Instrumentation instrumentation) {
        JvmAgentConfig config = new JvmAgentConfig(agentArgs);
        if (!config.isModeStop()) {
            startAgent(config,false, instrumentation);
        } else {
            stopAgent();
        }
    }
969526
private void modifiers(int modifiers) throws IOException {
    if ((modifiers & Modifier.PUBLIC) != 0) {
      out.write("public ");
    }
    if ((modifiers & Modifier.PRIVATE) != 0) {
      out.write("private ");
    }
    if ((modifiers & Modifier.PROTECTED) != 0) {
      out.write("protected ");
    }
    if ((modifiers & Modifier.STATIC) != 0) {
      out.write("static ");
    }
    if ((modifiers & Modifier.FINAL) != 0) {
      out.write("final ");
    }
    if ((modifiers & Modifier.ABSTRACT) != 0) {
      out.write("abstract ");
    }
    if ((modifiers & Modifier.SYNCHRONIZED) != 0) {
      out.write("synchronized ");
    }
    if ((modifiers & Modifier.TRANSIENT) != 0) {
      out.write("transient ");
    }
    if ((modifiers & Modifier.VOLATILE) != 0) {
      out.write("volatile ");
    }
  }