forked from minhnh/rdf-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add model parsing and tests for distributions #2
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- support secorolab/metamodels#13 - add DistributionModel that for parsing univariate and multivariate versions of the uniform and normal distributions, as well as uniform rotation (3D) distribution - add method to sample using info from DistributionModel - add SampledQuantityModel that cache sample when requested - add unit test on a valid model that check sampling of all supported distributions - minor: use check_shacl_constraints func in test_python_model - minor: remove black precommit hook since conflicting with ruff
minhnh
added a commit
to minhnh/metamodels-bdd
that referenced
this pull request
Nov 19, 2024
- dependent on secorolab/metamodels#13 - dependent on secorolab/rdf-utils#2
vamsikalagaturu
approved these changes
Nov 20, 2024
- For compatibility with Python 3.11 and older, use single quote inside f-string - add dependency to numpy - test against Python versions in Ubuntu 22.04, 24.04, and latest
- add a function to create distribution for a SampledQuantity node - add optional deps for distrib models, update workflow - clean up double quote f-string in test
argenos
approved these changes
Nov 20, 2024
minhnh
added a commit
to minhnh/metamodels-bdd
that referenced
this pull request
Feb 27, 2025
## Changelog ### BDD - Differentiate types of variations with `TableVariation` & `CartesianProductVariation` - Add `WhenBehaviour` - Add set quantifiers `ForAll` & `ThereExists` - Add concepts to link fluents, behaviours to their implementations - Add `ScenarioExecution` and more specific concepts to compose impl. concepts - Remove `Fluent` in favour of adding predicates types to `FluentClause` for simplification - Update SHACL constraints for BDD MM ### Other MMs - Add `Pick` & `Place` as behaviour types, allowing composition, which may need some further conceptual brainstorming - Add Simulation MM & SHACL to link elements to corresponding simulation resources - Add more specific concepts to link time constraints to event, add `DuringEventsConstraint`, update SHACL for time MM - Add concepts to link objects, workspaces, agents to their models - Add SHACL for environment & agent MM ## Related PRs - Distribution MM migrated in secorolab/metamodels#13 - Extensions to geometry metamodels will be migrated with secorolab/metamodels#22 ## Commits * add simulation metamodel - add concepts for specifying simulation resources - add SHACL constraints for these concepts * add geometry extension and distribution MM - add a concept for composing a pose coordinate from position and orientation - add concept for different types of orientation coordinates - add concept for sampled quantities and some default distributions - add SHACL constraints for the metamodels - the distribution concepts are migrated from the probability metamodel in secorolab/models * add concepts for scenario exec, scenario variant - ScenarioVariant was not explicitly defined - add concepts for specifying the execution environment, as well as implementations for behaviour and fluents * add type, ns for USD, Isaacsim * move object model concepts to environment mm * change SimulatedObject to ModelledObject - move SimulatedObject in simulation MM to ModelledObject in environment. Semantically, this means object models can exist independent of simulation. An object can be associated with many models. - change sim:object-model to env:has-object-model - add SHACL constraints for environment MM, migrate constraints from simulation SHACL * add modelled agent concepts similar to modelled object * remove of-constraint path constraint in favour of multi-type * add different types of variations - remove `:can-be` concept used for variation per each variable - add CartesianProductVariation to denote variations as the cartesian product of sets of possible values for a specified list of variables. This is a reification of the previous behaviour, introduced to allow different types of variations. - add TableVariation concept to specify variations as a table, where each row contains values of a specified list of variables for a single execution. - add Combination to specify selecting a list of distinct members from a set (as opposed to Permutation) - update SHACL constrants for the new concepts * migrate distribution MM to secorolab/metamodels - dependent on secorolab/metamodels#13 - dependent on secorolab/rdf-utils#2 * add Permutation, change dim to length * add metamodel for quantifiers, adapt SHACL * update quantifier & scenario variant constraints - :ForAll must link to a :When - :ThereExists must link to a :Given or :Then - :ScenarioVariant can have 0 or 1 :has-clause property - :ScenarioTemplate, :ForAll, :ThereExists must have exactly 1 :has-clause property * add domain-specific behaviours, WhenBehaviour - add WhenBehaviour concept that compose a behavour with relevant parameters to represent a complete "when behaviour" clause - add domain-specific concepts for pick and place behaviours - adapt SHACL constraint accordingly * add target-agent predicate * disallow container in in-set * remove pickplace behaviour and properties pick and place behaviours will be handled as one with both :Pick and :Place types, and pick workspace is removed as a specialized property * add MoveSafelyPredicate, DuringEventsConstraint - change :ref-event predicate to :before-event & :after-event - update SHACL time constraints - add predicate to represent the agent is moving safely * remove Fluent in flavour of multi-type FluentClause * migrate geometry metamodels migration planned in secorolab/metamodels#22
minhnh
added a commit
to minhnh/bdd-dsl
that referenced
this pull request
Mar 4, 2025
migrated in secorolab/rdf-utils#2
minhnh
added a commit
to minhnh/bdd-dsl
that referenced
this pull request
Mar 5, 2025
- probability model processing was migrated in secorolab/rdf-utils#2 - geometry model processing will be migrated in secorolab/rdf-utils#4
minhnh
added a commit
to minhnh/bdd-dsl
that referenced
this pull request
Mar 6, 2025
migrated in secorolab/rdf-utils#2
minhnh
added a commit
to minhnh/bdd-dsl
that referenced
this pull request
Mar 6, 2025
- probability model processing was migrated in secorolab/rdf-utils#2 - geometry model processing will be migrated in secorolab/rdf-utils#4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DistributionModel
for parsing univariate and multivariate versions of the uniform and normal distributions, as well as a distribution for generating uniform random rotations in 3D space.DistributionModel
distrib_from_sampled_quantity
to get the distribution model from aSampledQuantity
nodecheck_shacl_constraints
func intest_python_model