Ignore:
Timestamp:
09/23/13 18:54:07 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add SimultorProviders? hierarchy
  • start Framsticks server over SSH
  • FJF compatible with Framsticks 4.0rc3
  • reading and writing of standard.expt
  • a proof-of-concept implementation of StandardExperiment?

CHANGELOG:
Optionally return FreeAccess? from registry.

Add SimulatorRange?.

StandardExperiment? with genotypes circulation.

Automate registration around StandardState?.

More improvements to StandardExperiment?.

Skeleton version of StandardExperiment?.

Test saving of StandardState?.

Standard experiment state is being loaded.

More development towards StandardState? reading.

Work on reading standard experiment state.

Add classes for standard experiment.

Update example standard.expt

Add FreeAccess? and FreeObject?.

Made compatible with version 4.0rc3

Change deserialization policy.

Improve SSH support.

Working running simulator over SSH.

Fix joining bug in Experiment.

Working version of SimulatorRunner?.

Add more SimulatorProviders?.

Working PrimeExperimentTest? with 4.0rc3

Add references to deserialization.

Add OpaqueObject? and it's serialization.

Add deserialization of dictionaries.

Partial implementation of deserialization.

Add more tests for deserialization.

Prepare tests for deserialization.

Add proper result to prime experiment test.

Minor fixes to simulators providers.

Draft version of SimulatorProvider?.

Add SimulatorProvider? interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/params/UniqueListAccess.java

    r105 r107  
    187187        }
    188188
     189        public int setUidOf(Object value, String uid) {
     190                return uidAccess.select(value).set(uidName, uid);
     191        }
     192
     193        protected int uidCounter = 1;
     194
     195        public String generateNextUid() {
     196                return containedTypeName.substring(0, 1).toUpperCase() + Integer.toString(uidCounter++);
     197        }
     198
     199        public String findNextFreeUid() {
     200                String uid;
     201                do {
     202                        uid = generateNextUid();
     203                } while (get(uid, Object.class) != null);
     204                return uid;
     205        }
     206
    189207        protected int setByUid(Object object, String uid) {
    190208                if (uid == null) {
    191209                        uid = getUidOf(object);
    192210                        if (uid == null) {
    193                                 log.error("failed to set - missing uid");
    194                                 return 0;
     211                                uid = findNextFreeUid();
     212                                setUidOf(object, uid);
    195213                        }
    196214                }
     
    205223        @Override
    206224        public <T> int set(int i, T value) {
    207                 if (i != map.size()) {
    208                         throw new FramsticksUnsupportedOperationException().msg("setting element in unique list through index is available only for addition");
    209                 }
    210                 set(getUidOf(value), value);
    211                 return 0;
     225                if (value != null) {
     226                        if (i != map.size()) {
     227                                throw new FramsticksUnsupportedOperationException().msg("setting element in unique list through index is available only for addition");
     228                        }
     229                        set(getUidOf(value), value);
     230                        return 0;
     231                }
     232                if (i >= map.size()) {
     233                        throw new FramsticksUnsupportedOperationException().msg("invalid index for removal");
     234                }
     235                Object current = get(i, Object.class);
     236                return setByUid(null, getUidOf(current));
    212237        }
    213238
    214239        @Override
    215240        public <T> int set(String id, T value) {
     241                if (id == null) {
     242                        return setByUid(value, null);
     243                }
    216244                Integer i = Numbers.parse(id, Integer.class);
    217245                if (i != null) {
Note: See TracChangeset for help on using the changeset viewer.