Skip to content

Instantly share code, notes, and snippets.

@Rex-Ferrer
Last active February 26, 2021 22:20
Show Gist options
  • Save Rex-Ferrer/e521b8f19ddb85bf7fdcb75335a5c8cd to your computer and use it in GitHub Desktop.
Save Rex-Ferrer/e521b8f19ddb85bf7fdcb75335a5c8cd to your computer and use it in GitHub Desktop.
[WIP] OOP practice - Brain Modeling
class Lobe {}
class Temporal implements Lobe {}
class Frontal implements Lobe {
MemoryProcessor processor;
Object process(Effortful memory){
return processor.process(memory);
}
}
class Parietal implements Lobe {}
class Occipital implements Lobe {}
class Cortex {}
class Cerebral implements Cortex {}
class Cerebellar implements Cortex {}
class Thalamus {}
class Hypothalamus extends Thalamus {}
class Medulla {}
class Pons {}
class Hippocampus {
MemoryProcessor processor;
Object process(Effortful memory){
return processor.process(memory);
}
}
class Brain {
Cerebrum cerebrum;
Cerebellum cerebellum;
Brainstem brainstem;
}
class Cerebrum {
Hemisphere left;
Hemisphere right;
}
class Hemisphere {
Frontal frontal;
Temporal temporal;
Parietal parietal;
Occipital occipital;
CorpusCallosum corpus_callosum;
}
class Cerebellum {
Cerebellar cortex;
MemoryProcessor processor;
Object process(Automatic memory){
return processor.process(memory);
}
}
class BasalGanglia {
MemoryProcessor processor;
Object process(Automatic memory){
return processor.process(memory);
}
}
class Brainstem {}
//Mediator type object
class CorpusCallosum {}
// Tagging interfaces. Need to reconsider this. Enums could be better
class Hind {}
class Mid {}
class Fore {}
class Right {}
class Left {}
abstract class Gland {
Object produce();
Object release();
}
abstract class Endocrine implements Gland {}
abstract class Exocrine implements Gland {}
class Pituitary implements Gland {
Object produce() {
return null;
}
Object release() {
return null;
}
}
class Pineal implements Gland {
Object produce() {
return null;
}
Object release() {
return null;
}
}
class Memory {}
class Automatic implements Memory{}
class Effortful implements Memory {}
class Explicit implements Effortful {}
class Implicit implements Automatic {}
abstract class Semantic implements Explicit {}
abstract class Episodic implements Explicit {}
// 1. This class could be implemented by Frontal Lobe/Hippocampus and Cerebellum/Basal Ganglia
// 2. Preferred Method: Composition. Each of those classes contains this as an object property
// 2a. Containing class will delegate to this class, but will require the appropriate type of Memory
class MemoryProcessor {
Object process(Memory memory){
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment