Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
65fd7bc0
Commit
65fd7bc0
authored
Oct 01, 2016
by
Jakob Schöttl
Browse files
Bugfix: half-compartments were not considered
parent
3bc99890
Changes
2
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/models/seating/SeatingModel.java
View file @
65fd7bc0
...
...
@@ -110,7 +110,7 @@ public class SeatingModel implements ActiveCallback, Model {
private
void
assignSeatTarget
(
Pedestrian
p
)
{
final
Compartment
compartment
=
trainModel
.
getCompartment
(
p
);
if
(
compartment
.
getPersonCount
()
==
Compartment
.
MAX_PERSONS_PER_COMPARTMENT
)
{
if
(
compartment
.
isFull
()
)
{
logDebug
(
"Compartment %d is full. No seat available for pedestrian %d."
,
compartment
.
getIndex
(),
p
.
getId
());
proceedToNextCompartmentIfPossible
(
p
);
...
...
VadereSimulator/src/org/vadere/simulator/models/seating/trainmodel/Compartment.java
View file @
65fd7bc0
...
...
@@ -88,4 +88,12 @@ public class Compartment {
return
getSeatGroups
().
stream
().
mapToInt
(
SeatGroup:
:
getPersonCount
).
sum
();
}
public
boolean
isFull
()
{
for
(
SeatGroup
sg
:
seatGroups
)
{
if
(!
sg
.
isFull
())
return
false
;
}
return
true
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment