Skip to content
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

ResourceSimulation cannot handle scaled models with passive resources. #40

Open
stiesssh opened this issue Aug 18, 2023 · 0 comments
Open
Assignees

Comments

@stiesssh
Copy link
Collaborator

stiesssh commented Aug 18, 2023

Scenario

I tried to scale an adapted version of our TaskExample, i.e. a model with a single passive resource.

Problematic Behaviour

The model scales just fine, let's assume the newly added assembly is called A2. However, as soon as ResourceSimulation receives an ResourceDemandRequest from A2, the request does not match the key of the passiveResource.

Problem is in this piece of code in Operation initiatePassiveResource :

final Optional<SimplePassiveResource> passiveResourceInstance = this.passiveResourceTable
				.getPassiveResource(PassiveResourceCompoundKey.of(passiveResource, assemblyContext));

We build the key as passiveResource ID : assembly ID, but there are now, after scaling, new assemblies, with new IDs that need to access the same old passive resource.
But the key was build from the old assmbly only, thus we cannot get the passive resource in the table anymore.

Suggestions for fixes

1. change the implementation of the PassiveResourceCompoundKey. Passice resource have their own unique ID, why do we need a compound key at all?
2. upon receiving a ModelAdjusted event, also update the passive resource table with new entries for all new assemblies.

EDIT : I missunderstood how to passive resources are supposed to be interpreted!!
conv

So i guess, the fix is to create a new passive resource for the new assembly and put it into the table :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants