<commit_before>// Copyright (C) 2011 - 2012 by <NAME>, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.

#ifndef COPASI_CModelParameter
#define COPASI_CModelParameter

#include <set>

#include "copasi/report/CCopasiObjectName.h"

class CModelParameterSet;
class CModelParameterGroup;
class CCopasiObject;
class CExpression;
class CModel;

class CModelParameter
{
  friend std::ostream &operator<<(std::ostream &os, const CModelParameter & o);

public:
  enum Type
  {
    Model,
    Compartment,
    Species,
    ModelValue,
    ReactionParameter,
    Group,
    Set,
    unknown
  };

  static const char * TypeNames[];

  enum CompareResult
  {
    Obsolete,
    Missing,
    Modified,
    Identical
  };

  enum Framework
  {
    Concentration = 0,
    ParticleNumbers
  };

private:
  /**
   * The default constructor is hidden.
   */
  CModelParameter();

public:
  /**
   * Constructor
   */
  CModelParameter(CModelParameterGroup* pParent,
                  const CModelParameter::Type& type);
  /**
   * Copy constructor
   */
  CModelParameter(const CModelParameter& src, CModelParameterGroup* pParent);

public:
  /**
   * Destructor
   */
  virtual ~CModelParameter();
  void setParent(CModelParameterGroup* pParent);
  CModelParameterGroup* getParent() const;
  const Type& getType() const;
  virtual void setCN(const CCopasiObjectName& cn);
  const CCopasiObjectName& getCN() const;
  virtual void setValue(const double& value, const Framework& framework =
                          ParticleNumbers);
  const virtual double& getValue(
    const Framework& framework = ParticleNumbers) const;
  void setInitialExpression(const std::string& initialExpression);
  std::string getInitialExpression() const;
  void setCompareResult(const CompareResult& compareResult);
  const CompareResult& getCompareResult() const;
  size_t getIndex() const;
  bool isReadOnly() const;
  CCopasiObject* getObject() const;
  CModelParameterSet * getSet() const;
  CModel* getModel() const;
  bool isInitialExpressionValid() const;
  virtual std::string getName() const;
  virtual void compile();
  const virtual CompareResult& diff(const CModelParameter& other);
  virtual bool updateModel();

protected:
  static std::string nameFromCN(const CCopasiObjectName& cn);

protected:
  CModelParameterGroup* mpParent;
  Type mType;
  CRegisteredObjectName mCN;
  double mValue;

  CExpression * mpInitialExpression;

  CompareResult mCompareResult;

  CCopasiObject * mpObject;

  bool mIsInitialExpressionValid;<commit_msg>- patch as SWIG can't parse this file<commit_after>// Copyright (C) 2011 - 2012 by <NAME>, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.

#ifndef COPASI_CModelParameter
#define COPASI_CModelParameter

#include <set>

#include "copasi/report/CCopasiObjectName.h"

class CModelParameterSet;
class CModelParameterGroup;
class CCopasiObject;
class CExpression;
class CModel;

class CModelParameter
{
  friend std::ostream &operator<<(std::ostream &os, const CModelParameter & o);

public:
  enum Type
  {
    Model,
    Compartment,
    Species,
    ModelValue,
    ReactionParameter,
    Group,
    Set,
    unknown
  };

  static const char * TypeNames[];

  enum CompareResult
  {
    Obsolete,
    Missing,
    Modified,
    Identical
  };

  enum Framework
  {
    Concentration = 0,
    ParticleNumbers
  };

private:
  /**
   * The default constructor is hidden.
   */
  CModelParameter();

public:
  /**
   * Constructor
   */
  CModelParameter(CModelParameterGroup* pParent,
                  const CModelParameter::Type& type);
  /**
   * Copy constructor
   */
  CModelParameter(const CModelParameter& src, CModelParameterGroup* pParent);

public:
  /**
   * Destructor
   */
  virtual ~CModelParameter();
  void setParent(CModelParameterGroup* pParent);
  CModelParameterGroup* getParent() const;
  const Type& getType() const;
  virtual void setCN(const CCopasiObjectName& cn);
  const CCopasiObjectName& getCN() const;
#ifndef SWIG
  virtual void setValue(const double& value, const Framework& framework =
                          ParticleNumbers);
  const virtual double& getValue(
    const Framework& framework = ParticleNumbers) const;
#endif
  void setInitialExpression(const std::string& initialExpression);
  std::string getInitialExpression() const;
  void setCompareResult(const CompareResult& compareResult);
  const CompareResult& getCompareResult() const;
  size_t getIndex() const;
  bool isReadOnly() const;
  CCopasiObject* getObject() const;
  CModelParameterSet * getSet() const;
  CModel* getModel() const;
  bool isInitialExpressionValid() const;
  virtual std::string getName() const;
  virtual void compile();
#ifndef SWIG
  const virtual CompareResult& diff(const CModelParameter& other);
#endif
  virtual bool updateModel();

protected:
  static std::string nameFromCN(const CCopasiObjectName& cn);

protected:
  CModelParameterGroup* mpParent;
  Type mType;
  CRegisteredObjectName mCN;
  double mValue;

  CExpression * mpInitialExpression;

  CompareResult mCompareResult;

  CCopasiObject * mpObject;

  bool mIsInitialExpressionValid;
{'fraction_non_alphanumeric': 0.0908745247148289, 'fraction_numerical': 0.0034220532319391636, 'mean_word_length': 4.102812803103783, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '219495', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1531, 'n_words': 432}