Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sre] Parallel execution of the "on" handlers is now done through the…
… agent's Schedules capacity. Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
d01c609
commit 5343414
Showing
12 changed files
with
324 additions
and
65 deletions.
There are no files selected for viewing
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
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
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
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
42 changes: 42 additions & 0 deletions
42
...roject/io.janusproject.plugin/src/io/sarl/sre/skills/internal/DefaultEventBusFactory.sarl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2020 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.sarl.sre.skills.internal | ||
|
||
import io.sarl.sre.capacities.InternalSchedules | ||
import io.sarl.sre.internal.BehaviorGuardEvaluatorRegistry | ||
import java.util.function.Supplier | ||
|
||
/** | ||
* Factory of event bus. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.11 | ||
*/ | ||
class DefaultEventBusFactory implements EventBusFactory { | ||
|
||
override createEventBus(provider : Supplier<InternalSchedules>) : EventBus { | ||
new EventBus(provider, new BehaviorGuardEvaluatorRegistry) | ||
} | ||
|
||
} |
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
40 changes: 40 additions & 0 deletions
40
....janusproject/io.janusproject.plugin/src/io/sarl/sre/skills/internal/EventBusFactory.sarl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2020 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.sarl.sre.skills.internal | ||
|
||
import io.sarl.sre.capacities.InternalSchedules | ||
import java.util.function.Supplier | ||
|
||
/** | ||
* Factory of event bus. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.11 | ||
*/ | ||
interface EventBusFactory { | ||
|
||
/** Create the event bus. */ | ||
def createEventBus(provider : Supplier<InternalSchedules>) : EventBus | ||
|
||
} |
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
54 changes: 54 additions & 0 deletions
54
...janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/mocks/SourceAgent2.sarl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2020 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.sarl.sre.tests.runtime.spaces.mocks | ||
|
||
import io.sarl.core.Behaviors | ||
import io.sarl.core.Lifecycle | ||
import io.sarl.core.MemberLeft | ||
import io.sarl.core.Schedules | ||
import io.sarl.sre.tests.testutils.TestingAgent | ||
import io.sarl.core.InnerContextAccess | ||
|
||
/** | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
*/ | ||
agent SourceAgent2 extends TestingAgent { | ||
|
||
uses Behaviors, Lifecycle, Schedules, InnerContextAccess | ||
|
||
def runAgentTest : RunPolicy { | ||
var id = typeof(TargetAgent).spawnInContext(innerContext, agentInitializationParameters) | ||
addResult(id) | ||
in(1000) [ | ||
wake(new TestEvent(ID)) | ||
] | ||
return RunPolicy::STANDARD | ||
} | ||
|
||
on MemberLeft { | ||
killMe | ||
} | ||
|
||
} |
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
Oops, something went wrong.