Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
4d12f6e
feat: first basic dsl
MarcoFratta Sep 3, 2025
d4e9fab
feat: add deployments dsl
MarcoFratta Sep 4, 2025
47064ef
refactor: handle generic types
MarcoFratta Sep 4, 2025
4956fd5
feat: add contents handling
MarcoFratta Sep 5, 2025
fce6863
feat: handle linking rule
MarcoFratta Sep 5, 2025
92e3642
chore: change error message
MarcoFratta Sep 5, 2025
c73e885
test: improve testing
MarcoFratta Sep 5, 2025
72f404e
feat!: add support for actions and conditions
MarcoFratta Sep 10, 2025
c1dd1a9
test: add tests for new features
MarcoFratta Sep 10, 2025
2e10f24
feat: add support for terminators
MarcoFratta Sep 10, 2025
92fdfef
refactor: simplify dsl syntax
MarcoFratta Sep 11, 2025
4b99ab3
feat: add support for output monitors
MarcoFratta Sep 11, 2025
1d7f3dc
feat: add support for layers
MarcoFratta Sep 11, 2025
10e556f
feat: improve test framework
MarcoFratta Oct 15, 2025
4f3b1d5
feat: add support for exporters and global reactions
MarcoFratta Oct 15, 2025
9fb52a4
feat: add support for variables using delegates
MarcoFratta Oct 15, 2025
6e2d517
fix: fix seeds problem
MarcoFratta Oct 27, 2025
995d89c
refactor: refactor dsl structure
MarcoFratta Oct 27, 2025
b64f9df
feat: add support for custom nodes definition
MarcoFratta Oct 28, 2025
4cf3303
feat: add support for node properties
MarcoFratta Oct 28, 2025
1d69e8b
refactor: add code initial documentation
MarcoFratta Nov 8, 2025
a27650a
refactor: move yml test files
MarcoFratta Nov 8, 2025
16f38f2
refactor: add doc and better testing
MarcoFratta Nov 8, 2025
08618a2
feat!: add support for alchemist.kts file loading
MarcoFratta Nov 8, 2025
a6bf860
feat!: add support for alchemist.kts file loading
MarcoFratta Nov 8, 2025
4f7167a
test: test .alchemist.kts file loading
MarcoFratta Nov 8, 2025
27a5c13
refactor: add external imports config file
MarcoFratta Nov 8, 2025
78bfff8
feat!: add ksp function helpers generator
MarcoFratta Nov 8, 2025
597becc
feat!: add ksp function helpers generator
MarcoFratta Nov 8, 2025
b0c71f8
feat: add @BuildDsl to some classes
MarcoFratta Nov 8, 2025
ca75361
refactor: better code organization
MarcoFratta Nov 10, 2025
f286d6c
test: add performance tests
MarcoFratta Nov 10, 2025
500c19c
feat: add support for batch runs
MarcoFratta Nov 16, 2025
f382537
feat: add custom scope definition for @BuildDsl annotation
MarcoFratta Nov 16, 2025
05b5415
test: add test simulation config
MarcoFratta Nov 16, 2025
d19e1d2
style: improve formatting
MarcoFratta Nov 25, 2025
5169700
refactor: refactor build.gradle.kts dependency
MarcoFratta Nov 25, 2025
1595d29
feat: add multiplatform support
MarcoFratta Nov 25, 2025
3f8083a
chore: remove useless comment
MarcoFratta Nov 25, 2025
188d4c2
feat: change alchemist script definition
MarcoFratta Nov 26, 2025
eead30d
chore: add dependencies versions
MarcoFratta Nov 26, 2025
8828e2e
fix: fix processor tests
MarcoFratta Nov 26, 2025
fb37157
chore: remove println
MarcoFratta Nov 26, 2025
a2621ee
style: remove redundant parenthesis
MarcoFratta Nov 26, 2025
044f0cf
style: remove redundant parenthesis
MarcoFratta Nov 26, 2025
a484608
chore: remove not needed compiler arg
MarcoFratta Nov 26, 2025
0956133
feat: remove CommitMessageInspectionProfile from vcs.xml
MarcoFratta Nov 26, 2025
cd0c944
fix: fix cpd errors
MarcoFratta Nov 26, 2025
ea828ba
fix: fix cpd errors in alchemist-loading
MarcoFratta Nov 26, 2025
c64da66
fix: rename sources dir names
MarcoFratta Nov 26, 2025
c7127ee
style: fix vertical spacing inconsistencies
MarcoFratta Nov 26, 2025
ba61b9a
style: fix vertical spacing inconsistencies
MarcoFratta Nov 26, 2025
52636bf
refactor: simplify expression
MarcoFratta Nov 26, 2025
af61a31
refactor: simplify expressions
MarcoFratta Nov 26, 2025
a56fd43
refactor: change annotation from @BuildDsl to @AlchemistKotlinDSL
MarcoFratta Nov 26, 2025
a6d8b1f
docs: add missing documentation
MarcoFratta Nov 26, 2025
ee56135
style: fix detekt errors
MarcoFratta Nov 27, 2025
05a8752
style: fix detekt errors
MarcoFratta Nov 27, 2025
51de749
refactor: replace exporters function signature
MarcoFratta Nov 28, 2025
674e877
refactor: better performance test
MarcoFratta Nov 28, 2025
2ea8fc0
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
9507746
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
3c66daa
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
032ccc1
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
24a9e52
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
11ad0c2
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
4b4f9f3
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
4998e63
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
eab6d0f
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
49a2e12
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
4d40681
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
49c7b45
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
bee728d
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
ff8ea2d
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
ba8b186
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
6103fb7
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
6a6b0d7
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
da1f7f3
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
78017ad
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
4ff63a3
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
6ab908c
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
53b1f46
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
2f60464
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
3f95b73
chore(build): update the javadoc.io cache
DanySK Dec 1, 2025
1a83976
style(dsl-processor): cleanup `ConstructorFinder`
DanySK Dec 15, 2025
2b32e8b
build: remove duplicate `-Xcontext-parameters` argument in compiler o…
DanySK Dec 15, 2025
179a143
chore: add copyright notice to BoundProcessor.kt
DanySK Dec 15, 2025
ee50373
refactor: simplify type argument formatting in BoundProcessor.kt
DanySK Dec 15, 2025
9803adf
chore: remove unnecessary blank line in build.gradle.kts
DanySK Dec 15, 2025
fa1cfe5
chore: remove unused jvm() configuration and test dependencies in bui…
DanySK Dec 15, 2025
f8923e9
refactor: streamline logging in DslBuilderProcessor.kt
DanySK Dec 15, 2025
bdcb64a
style: use orEmpty()
DanySK Dec 15, 2025
dc38124
chore: track the dokka caches
DanySK Dec 15, 2025
4cab178
fix: split support types to separate files
DanySK Dec 15, 2025
6dd95b4
refactor: move InjectionType to a separate data package
DanySK Dec 15, 2025
f87345e
refactor: improve logging and structure in DslBuilderProcessor
DanySK Dec 15, 2025
d1dd082
refactor: refactor the Kotlin DSL generator
DanySK Dec 18, 2025
bb9b693
refactor: enhance context handling in DslBuilderProcessor and Paramet…
DanySK Dec 18, 2025
bfd3eff
refactor: extract ContextType enum to a new file for better organization
DanySK Dec 18, 2025
2ed2287
refactor: simplify type checks in ParameterInjector by using isSubtypeOf
DanySK Dec 18, 2025
ddaf97d
refactor: simplify manual scope check in ParameterInjector
DanySK Dec 18, 2025
569d80f
refactor: make ProcessorConfig internal and remove unused type consta…
DanySK Dec 18, 2025
95c6f82
refactor: remove redundant logging of found symbols in DslBuilderProc…
DanySK Dec 18, 2025
2568f41
refactor: simplify AlchemistKotlinDSL annotation and remove unused pa…
DanySK Dec 18, 2025
5b5326d
marmellata
DanySK Dec 19, 2025
abc47f7
marmellata
DanySK Dec 22, 2025
5d48407
feat!: rewrite the code generator
DanySK Dec 23, 2025
418a8ea
refactor: suppress Detekt false positives for undocumented public fun…
DanySK Dec 23, 2025
5275f1a
refactor: streamline DslBuilderProcessor by removing unused imports a…
DanySK Dec 23, 2025
20a9611
feat: enhance simulation context to include RandomGenerator in DSL fu…
DanySK Dec 23, 2025
b262105
feat: enhance DSL functions with context support for RandomGenerator …
DanySK Dec 23, 2025
54f80ce
fix: update copyright year and improve GlobalTestReaction usage in tests
DanySK Dec 23, 2025
3b5c58d
fix: update copyright year to 2025 in Circle.java
DanySK Dec 24, 2025
971256d
fix: update copyright year to 2025 in CircularArc.kt
DanySK Dec 24, 2025
7e02294
fix: update copyright year to 2025 in multiple files
DanySK Dec 24, 2025
aea5ca4
fix: remove scope from AlchemistKotlinDSL annotation in TestNode.java
DanySK Dec 24, 2025
5a350a8
fix: remove scope from AlchemistKotlinDSL annotation in TestNode.java
DanySK Dec 24, 2025
9ddc782
fix: update context parameters in simulation function and change anno…
DanySK Dec 24, 2025
db323d1
fix: suppress Detekt false positive for undocumented public function …
DanySK Dec 24, 2025
055cce9
fix: update copyright year to 2025 in build.gradle.kts
DanySK Dec 24, 2025
d4ac5bf
build: use the correct ksp dependency
DanySK Dec 24, 2025
1d99cc8
fix: update globalTestReaction call to use generic type and correct R…
DanySK Dec 24, 2025
124bf87
refactor: remove AlchemistKotlinDSL annotation from multiple classes
DanySK Dec 26, 2025
4f65913
refactor: major redesign of the DSL
DanySK Jan 1, 2026
15712fa
fixup!: continue refactoring the DSL
DanySK Jan 1, 2026
798255c
chore: remove redundant type bound
DanySK Jan 3, 2026
cdde10a
refactor: update context parameters in DSL methods for consistency
DanySK Jan 3, 2026
b8efa8b
refactor: update deployment context methods for improved node factory…
DanySK Jan 5, 2026
0451039
fix: most of the DSL works
DanySK Jan 22, 2026
968c391
fix(loading): provide an environment factory when instancing the simu…
DanySK Jan 23, 2026
d1c806d
fix(loading): fix simple test
DanySK Jan 23, 2026
3d1c4c2
chore: explain why an unused private member warning is suppressed
DanySK Jan 23, 2026
fdcbc09
chore: sort imports
DanySK Jan 23, 2026
c0838b3
refactor: another gigantic refactor, holy shit
DanySK Jan 23, 2026
2a220c6
refactor: another gigantic refactor, holy shit
DanySK Jan 23, 2026
b17fe00
chore: try to make the scripting engine work in the ide
DanySK Jan 23, 2026
681b180
refactor: fix scafi and refactor repetitive test
DanySK Jan 25, 2026
d25bbb9
test: import missing class
DanySK Jan 26, 2026
8216849
build: consolidate Compose dependencies into a single bundle
DanySK Jan 26, 2026
6737cda
test(incarnation-scafi): update import path for ScafiIncarnation
DanySK Jan 26, 2026
57ff74f
refactor: change AlchemistScript from abstract class to interface
DanySK Jan 26, 2026
fc10e59
test: add missing import for `SAPEREIncarnation` in `RegressionTest`
DanySK Jan 26, 2026
9e4e1cf
fix: fix broken subnetwork provisioning
DanySK Jan 26, 2026
d8c4080
test: add missing import for `SAPEREIncarnation` in `TestIncarnation`
DanySK Jan 26, 2026
ae251e3
test: simplify variables testing
DanySK Jan 26, 2026
092f0b2
test: correct import for `SAPEREIncarnation` in `LsaNodeConcurrencyTest`
DanySK Jan 26, 2026
0162b30
fix: update assertion to use `allSubNetworks()` in `TestEnvironmentsD…
DanySK Jan 26, 2026
f97e50d
chore: move copyright header
DanySK Jan 26, 2026
bfbb6fa
test: update diameter assertions to use dynamic subnetwork size
DanySK Jan 26, 2026
e62ed4a
refactor: remove unused random generator and update deployment context
DanySK Jan 27, 2026
9351dad
refactor: remove unused time distribution parameters and simplify sim…
DanySK Jan 27, 2026
cc0ac84
refactor: update random generator initialization and improve time dis…
DanySK Jan 27, 2026
57c54e4
DSL2
DanySK Jan 29, 2026
8cb6e6f
refactor: improve program function signature and update StableForStep…
DanySK Jan 29, 2026
74aa4c1
refactor: simplify time distribution handling and improve program con…
DanySK Jan 31, 2026
c5c6993
refactor: enhance global program handling and add layer support in si…
DanySK Feb 5, 2026
f79ec94
refactor: rename exporter classes and update copyright year
DanySK Feb 5, 2026
95ef0b7
implement node properties
DanySK Feb 5, 2026
263202b
begin implementation
DanySK Feb 6, 2026
439de26
refactor: enhance context handling and add support for launcher and m…
DanySK Feb 7, 2026
cd542c5
The new DSL seems to work
DanySK Feb 9, 2026
f0eaf93
style: remove unnecessary whitespace in TerminatorsContext.kt
DanySK Feb 9, 2026
57d4c68
style: reorder imports in SimulationContext.kt
DanySK Feb 9, 2026
2052a12
fix(incarnation-scafi): remove unused time parameter from action and …
DanySK Feb 9, 2026
41fa44d
style: apply KTLintFormat to AlchemistKotlinDSL.kt
DanySK Feb 9, 2026
f292e0d
style: apply KTLintFormat
DanySK Feb 9, 2026
4c38563
refactor: reorganize the new DSL
DanySK Feb 9, 2026
8616113
fix: improve no-op implementation in EmptyEnvironment
DanySK Feb 9, 2026
40ca49b
refactor: change NoNode from object to data object and remove unused …
DanySK Feb 9, 2026
a136212
chore: replace associate with associateWith for clarity in NetworkCen…
DanySK Feb 10, 2026
cdd3eeb
refactor: move isMeaningful extension property to companion object in…
DanySK Feb 10, 2026
124d06d
fix: ensure launcher can only be set once in DSLLoader
DanySK Feb 10, 2026
e05b2ef
docs: fix dokka dangling links
DanySK Feb 11, 2026
3322c5f
chore: drop unused `VariableProvider`
DanySK Feb 11, 2026
3fb533b
test: replace 'contains' with 'in' for position check in TestDSLLoading
DanySK Feb 11, 2026
d2c3da0
test: use diamond operator for Grid instantiation in TestGrid
DanySK Feb 11, 2026
cc3d73d
test: add suppression for name shadowing in TestVariables
DanySK Feb 11, 2026
5fd3c90
feat: implement VariableDelegateFactory for DSL variable delegation
DanySK Feb 12, 2026
08c7918
feat: refactor simulation setup and environment configuration in perf…
DanySK Feb 12, 2026
cb93dae
feat: update SimulationContext to include VariableDelegateFactory and…
DanySK Feb 12, 2026
c370bb4
feat: enhance createConcentration method to handle null and collectio…
DanySK Feb 12, 2026
11205f6
feat: fix regex pattern in SAPEREIncarnation to correctly match neste…
DanySK Feb 12, 2026
7995b1e
docs: update dokka version to 2.2.0-Beta
DanySK Feb 12, 2026
4dcf2bf
feat!: merge branch 'master' into feat/dsl2
DanySK Feb 14, 2026
d834300
Merge branch 'master' into feat/dsl2
DanySK Feb 14, 2026
20ffe8b
Merge branch 'master' into feat/dsl2
DanySK Feb 14, 2026
6bb9f5a
Merge branch 'master' into feat/dsl2
DanySK Feb 14, 2026
0b39b06
Merge branch 'master' into feat/dsl2
DanySK Feb 14, 2026
54ca2a2
Merge branch 'master' into feat/dsl2
DanySK Feb 14, 2026
9a235dd
chore: move ArbitraryVariable, Flag, LinearVariable, and NumericConst…
DanySK Feb 14, 2026
b5752f0
feat: update formulas in null bindings and add Variable interface
DanySK Feb 14, 2026
8f01dd4
feat: update DSL script to use simulation2D and improve environment s…
DanySK Feb 14, 2026
0486f16
midgame save
DanySK Feb 14, 2026
c2c85d0
feat: update simulation scripts to use simulation2D and improve envir…
DanySK Feb 15, 2026
2fa9ee5
Merge branch 'master' into feat/dsl2
DanySK Feb 15, 2026
18fe99e
feat: enable additional test cases for DSL script equivalence in Kotl…
DanySK Feb 15, 2026
ed34944
feat: update incarnation from SAPERE to Protelis in simulation scripts
DanySK Feb 15, 2026
5d7ec65
Merge branch 'master' into feat/dsl2
DanySK Feb 15, 2026
5999c8a
Merge branch 'master' into feat/dsl2
DanySK Feb 15, 2026
6761f38
feat: refactor DSL syntax and improve layer handling in environment
DanySK Feb 15, 2026
87af1d2
feat: simplify DSL syntax and enhance variable handling in simulation…
DanySK Feb 15, 2026
52bb68e
docs: add documentation for Alchemist script execution entry point
DanySK Feb 15, 2026
8627b69
Merge remote-tracking branch 'origin/master' into feat/dsl2
DanySK Feb 15, 2026
e9675d0
fix: improve exclusion logic for Detekt tasks in build.gradle.kts
DanySK Feb 15, 2026
92f61f2
Merge remote-tracking branch 'origin/master' into feat/dsl2
DanySK Feb 15, 2026
2b39344
test: reduce steps in LoadAlchemist test for efficiency
DanySK Feb 15, 2026
16e24e1
refactor: remove unnecessary suppression annotations and clean up code
DanySK Feb 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion alchemist-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies {
api(libs.jool)
api(libs.listset)
implementation(libs.kotlin.reflect)

testImplementation(libs.kotlin.test)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ Reaction<T> createReaction(
* @param node
* the node that will host this object. If it is `null` the actionable
* will not belong to a {@link Node}
* @param time
* the time distribution of the reaction
* @param actionable
* the actionable hosting this object
* @param additionalParameters
Expand All @@ -131,7 +129,6 @@ Condition<T> createCondition(
RandomGenerator randomGenerator,
Environment<T, P> environment,
@Nullable Node<T> node,
TimeDistribution<T> time,
Actionable<T> actionable,
@Nullable Object additionalParameters
);
Expand All @@ -144,8 +141,6 @@ Condition<T> createCondition(
* @param node
* the node that will host this object. If it is `null` the actionable
* will not belong to a {@link Node}
* @param time
* the time distribution of the reaction
* @param actionable
* the actionable hosting this object
* @param additionalParameters
Expand All @@ -156,7 +151,6 @@ Action<T> createAction(
RandomGenerator randomGenerator,
Environment<T, P> environment,
@Nullable Node<T> node,
TimeDistribution<T> time,
Actionable<T> actionable,
@Nullable Object additionalParameters
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ interface Environment<T, P : Position<out P>> :
/**
* Return all the Layers in this [Environment].
*/
val layers: ListSet<Layer<T, P>>
val layers: Map<Molecule, Layer<T, P>>

/**
* Returns the current [LinkingRule].
Expand Down
4 changes: 3 additions & 1 deletion alchemist-cognitive-agents/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2022, Danilo Pianini and contributors
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand All @@ -15,6 +15,8 @@ plugins {
}

dependencies {
ksp(alchemist("factories-generator"))

api(alchemist("api"))

implementation(alchemist("euclidean-geometry"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2023, Danilo Pianini and contributors
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand Down Expand Up @@ -28,6 +28,6 @@ import kotlin.reflect.KClass
class TypeBased<T>(
environment: Euclidean2DEnvironment<T>,
node: Node<T>,
typeWeights: LinkedHashMap<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>,
typeWeights: Map<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>,
defaultWeight: Double = 0.0,
) : Weighted<T>(environment, node, { typeWeights[this::class] ?: defaultWeight })
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2023, Danilo Pianini and contributors
* Copyright (C) 2010-2026, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand All @@ -11,7 +11,6 @@ package it.unibo.alchemist.model.cognitive

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
import it.unibo.alchemist.model.Incarnation
import it.unibo.alchemist.model.SupportedIncarnations
import it.unibo.alchemist.model.cognitive.properties.Pedestrian
import it.unibo.alchemist.model.cognitive.properties.Perceptive2D
Expand All @@ -31,14 +30,10 @@ import org.apache.commons.math3.random.RandomGenerator
*
* @param T used internally
*/
class TestSensory<T> :
StringSpec({
class TestSensory<T> : StringSpec({

fun createHomogeneousPedestrian(
incarnation: Incarnation<T, Euclidean2DPosition>,
randomGenerator: RandomGenerator,
environment: Physics2DEnvironment<T>,
) = GenericNode(incarnation, environment).apply {
fun createHomogeneousPedestrian(randomGenerator: RandomGenerator, environment: Physics2DEnvironment<T>) =
GenericNode(environment).apply {
listOf(
Pedestrian(randomGenerator, this),
Social(this),
Expand All @@ -47,32 +42,28 @@ class TestSensory<T> :
).forEach(this::addProperty)
}

"field of view" {
val environment =
ContinuousPhysics2DEnvironment<T>(
SupportedIncarnations.get<T, Euclidean2DPosition>("protelis").orElseThrow(),
)
val rand = MersenneTwister(1)
environment.linkingRule = NoLinks()
val incarnation: Incarnation<T, Euclidean2DPosition> =
SupportedIncarnations
.get<T, Euclidean2DPosition>(SupportedIncarnations.getAvailableIncarnations().first())
.get()
val observed = createHomogeneousPedestrian(incarnation, rand, environment)
val origin = Euclidean2DPosition(5.0, 5.0)
environment.addNode(observed, origin)
val radius = 10.0
origin.surrounding(radius).forEach {
with(createHomogeneousPedestrian(incarnation, rand, environment)) {
environment.addNode(this, it)
environment.setHeading(this, origin - it)
}
"field of view" {
val environment =
ContinuousPhysics2DEnvironment<T>(
SupportedIncarnations.get<T, Euclidean2DPosition>("protelis").orElseThrow(),
)
val rand = MersenneTwister(1)
environment.linkingRule = NoLinks()
val observed = createHomogeneousPedestrian(rand, environment)
val origin = Euclidean2DPosition(5.0, 5.0)
environment.addNode(observed, origin)
val radius = 10.0
origin.surrounding(radius).forEach {
with(createHomogeneousPedestrian(rand, environment)) {
environment.addNode(this, it)
environment.setHeading(this, origin - it)
}
environment.nodes.minusElement(observed).forEach {
with(FieldOfView2D(environment, it, radius, Math.PI / 2)) {
influentialNodes().size shouldBe 1
influentialNodes().first() shouldBe observed
}
}
environment.nodes.minusElement(observed).forEach {
with(FieldOfView2D(environment, it, radius, Math.PI / 2)) {
influentialNodes().size shouldBe 1
influentialNodes().first() shouldBe observed
}
}
})
}
})
17 changes: 5 additions & 12 deletions alchemist-composeui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import dev.detekt.gradle.Detekt
import it.unibo.alchemist.build.devServer
import it.unibo.alchemist.build.webCommonConfiguration
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

/*
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* Copyright (C) 2010-2026, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
* GNU General Public License, with a linking exception,
* as described in the file LICENSE in the Alchemist distribution's top directory.
*/

import it.unibo.alchemist.build.devServer
import it.unibo.alchemist.build.webCommonConfiguration
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
id("kotlin-multiplatform-convention")
alias(libs.plugins.compose.multiplatform)
Expand Down Expand Up @@ -46,8 +44,3 @@ publishing.publications.withType<MavenPublication>().configureEach {
}
}
}

// exclude files in build from Detekt
tasks.withType<Detekt>().configureEach {
exclude("**/alchemist_composeui/**")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* Copyright (C) 2010-2026, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand Down Expand Up @@ -36,7 +36,7 @@ internal class TestConcurrency {
fun `simulation commands should interleave`() {
val incarnation = BiochemistryIncarnation()
val environment = Continuous2DEnvironment(incarnation)
val node = GenericNode(incarnation, environment)
val node = GenericNode(environment)
environment.linkingRule = NoLinks()
val timeDistribution = DiracComb<Double>(1.0)
val reaction = Event(node, timeDistribution)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2023, Danilo Pianini and contributors
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand Down Expand Up @@ -68,7 +68,7 @@ class TestSimulationControl :

fun Environment<Nothing, *>.tickRate(delta: Double) {
this.simulation.schedule {
this.addGlobalReaction(GlobalTestReaction(DiracComb(Time.ZERO, delta), this))
this.addGlobalReaction(GlobalTestReaction(this, DiracComb(Time.ZERO, delta)))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
* GNU General Public License, with a linking exception,
* as described in the file LICENSE in the Alchemist distribution's top directory.
*/

package it.unibo.alchemist.core.test

import it.unibo.alchemist.model.Environment
Expand All @@ -24,7 +33,7 @@ object GoToTimeRegressionTest {

private fun Environment<Nothing, *>.tickRate(delta: Double) {
this.simulation.schedule {
this.addGlobalReaction(GlobalTestReaction(DiracComb(Time.ZERO, delta), this))
this.addGlobalReaction(GlobalTestReaction(this, DiracComb(Time.ZERO, delta)))
}
}

Expand Down
4 changes: 3 additions & 1 deletion alchemist-euclidean-geometry/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2022, Danilo Pianini and contributors
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand All @@ -15,6 +15,8 @@ plugins {
}

dependencies {
ksp(alchemist("factories-generator"))

api(alchemist("api"))
api(alchemist("implementationbase"))
api(libs.dyn4j)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2025, Danilo Pianini and contributors
* Copyright (C) 2010-2026, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
Expand Down Expand Up @@ -33,7 +33,7 @@ private Node<Integer> createIntNode(
final Incarnation<Integer, Euclidean2DPosition> incarnation,
final Environment<Integer, Euclidean2DPosition> environment
) {
return new GenericNode<>(incarnation, environment) {
return new GenericNode<>(environment) {
@Override
public Integer createT() {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package it.unibo.alchemist.model.interfaces.geometry

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
import io.kotest.core.spec.style.FreeSpec
import io.kotest.matchers.shouldBe
import it.unibo.alchemist.model.geometry.Euclidean2DShapeFactory
Expand All @@ -22,36 +21,24 @@ import it.unibo.alchemist.model.positions.Euclidean2DPosition
private val factory: Euclidean2DShapeFactory =
GeometricShapeFactory.getInstance<Euclidean2DPosition, Euclidean2DTransformation, Euclidean2DShapeFactory>()

@SuppressFBWarnings("SE_BAD_FIELD_STORE")
class TestEuclidean2DTransformation :
FreeSpec({
"Test origin" - {
factory
.oneOfEachWithSize(1.0)
factory.oneOfEachWithSize(1.0)
.filter { it.value !is AdimensionalShape }
.forEach {
it.key {
var shape =
it.value.transformed {
origin(0.0, 0.0)
}
var shape = it.value.transformed { origin(0.0, 0.0) }
val reference = shape.centroid
shape =
shape.transformed {
origin(0.0, 0.0)
}
shape = shape.transformed { origin(0.0, 0.0) }
reference.distanceTo(shape.centroid) shouldBe 0.0
shape =
shape.transformed {
origin(0.0, 10.0)
}
shape = shape.transformed { origin(0.0, 10.0) }
reference.distanceTo(shape.centroid) shouldBe 10.0
shape =
shape.transformed {
origin(10.0, 10.0)
origin(3.0, 3.0)
origin(6.0, 0.0)
}
shape = shape.transformed {
origin(10.0, 10.0)
origin(3.0, 3.0)
origin(6.0, 0.0)
}
reference.distanceTo(shape.centroid) shouldBe 6.0
}
}
Expand Down
Loading