Creating Instances in Python
The following code shows an example of createXXX
methods generated to cover the set of entities defined in the tutorial:
class CapacityPlanning(DbDomCollector): def create_activity(self) -> Acticity: pass def create_gene_issue(self) -> GeneIssue: pass def create_gene_parameter(self) -> GeneParameter: pass def create_precedence(self) -> Precedence: pass def create_requirement(self) -> Requirement: pass def create_resource(self) -> Resource: pass def create_resource_capacity(self) -> ResourceCapacity: pass def create_resource_usage_per_day(self) -> ResourceUsagePerDay: pass def create_schedule(self) -> Schedule: pass def create_solution_summary(self) -> SolutionSummary: pass
To create a resource, one would declare the following:
Resource res1 = coll.createResource();
Each instance is linked with its collector which can be accessed using the getCollector()
method.
res1.getCollector() == coll; // TRUE