Skip to content

Conversation

lesquoyb
Copy link
Contributor

@lesquoyb lesquoyb commented Jul 23, 2025

It's a work in progress

list of goals to attain to merge it to main

  • add the syntax to declare in gaml a new type composed of variable and action declarations, and have it recognized by the compiler
  • add the newly defined type to the model's list of types
  • fill the internal description of the newly defined type with the children variables and actions, this can include other user defined types or the type itself.
  • have the possibility to create objects of that type:
    • with an auto-generated constructor-like action
    • optionally through a statement like create
  • in gaml being able to access in read/write mode the component variables of an object of a user defined type
  • handle serialization/deserialization of those new types
  • optionally it would be the occasion to add a spark dataset/dataframe backed type to handle collections of those user defined types, this could bring a lot of benefits like faster processing of large collections of data, easier serialization/deserialization, easy access to complex properties, n-dimensional collections etc.
  • The variables of user defined types are visible and browsable in the inspector
  • add a parent data_type to the metamodel for common properties (for example the list of attributes)

Problems and bugs so far

  • inconsistent naming of type/kind/variables: data, data_type, composed, composed_data
  • missing icon for custom types in the model outline
  • the default facet is not recognized as the type name (must use the name facet for now
    • in general there are some cases where the default facet name is used and other where it's the name facet that is used: in the outline the default is used for example
  • a variable of a user defined type declared in the global cannot be used in the init block
  • there's an xtext error the first time we open an existing model from the library

lesquoyb added 6 commits July 15, 2025 16:09
be cautious, not sure what I'm doing here
- finish creating types and methods to handle data_type in the grammar and fix bugs
- add the new types to the model's types
- fill the new types with the variables defined inside
- replace placeholder code by notimplementedexception to be sure it'll be implemented
lesquoyb and others added 9 commits July 30, 2025 10:18
This commit refactors and extends the handling of user-defined data types in the GAMA platform. It introduces and documents the GamaData and GamaDataType classes, updates the ModelFactory to properly parent and manage data types, and adjusts the grammar and parser to recognize data types as first-class type definitions. The commit also improves error handling and code documentation throughout the data type management workflow.
Improves the management of DataTypeDescription in ModelDescription and TypeDescription by moving addChild logic from TypeDescription to DataTypeDescription, ensuring data types are added correctly. Updates ModelFactory to avoid complementing data nodes directly and clarifies JavaDoc comments. Also updates copyright and license headers.
- broke some part of built-in skills (like moving)
- starts separating user defined skills and built-in ones (to be completed)
- enable declaring skills in gaml, with the name being recognised in the skills facet of species
- content of the user defined skills is not imported in agents yet
- fixes some bugs with data_type
- move data_type methods to more appropriate sections of the code
- some more renaming for better understanding
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants