设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15186|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 f+ Y/ R/ p3 |: \

8 n, r8 x: |5 f7 C* n4 {0 n我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。4 a# H) N6 F5 g- O, a. o* w

3 ^/ L5 N* ~+ ?begin P_read arriving2 D. n0 V+ z  e: u  p
    while 1=1 do begin
" I. a9 P* E- d- t6 v3 H        read A_tote from "data.txt" with delimiter "\n"$ D) ?4 _2 A! f# s( |- z! I# O
        read A_time from "data.txt" with delimiter "\n"2 z9 {! Q8 X4 u8 W% b
        read A_leave from "data.txt" with delimiter "\n") L5 E# S& a& @0 A
        read A_picks from "data.txt" with delimiter "\n"3 e- r9 k) X+ p7 F+ }
        set load type to A_tote
7 {  R; Y( |+ f1 P        if A_tote="tote 1" then set A_induct to 1
- r5 W3 |; a& p9 X        else if A_tote="tote 2" then set A_induct to 2# Z% H  N1 j0 q- x8 Z
            else set A_induct to 3   
# {4 ^$ R9 B& |, P        set A_i to 00 Z; e' c( T$ B+ q: m
        clone 1 load to P_induction. O' k! e- i$ {( N" P/ o- j
        wait for A_time sec& V% `" v# f- m/ {- ~
    end  A: U. g7 G7 x9 e6 b) X, D6 S
end8 a! |& b7 i3 `8 s! r

6 g/ C' V. @+ R* v* }  J8 B( |begin P_induction arriving
3 E5 D( Y$ b, Y; `8 r1 ^    if A_induct=1 then clone 1 load to P_pick1
7 q; ]" a) g" t2 S1 r6 W  h    else if A_induct=2 then clone 1 load to P_pick2
6 U' h0 l2 G6 P8 z+ s        else clone 1 load to P_pick3
$ N5 f, A, c2 G" B4 d/ vend) d* q. e* d6 W3 Y2 x6 p" n

/ }+ [* l8 S1 O6 X- Gbegin P_pick1 arriving: Q0 B. \9 B( a1 J% U
    set A_i to 1
8 v. O  s, a3 S7 R    move into Q_induct1, g! f. r$ p" e; a" V
    move into pickaisle.induct1
' {7 l) B+ a6 H    while A_i<=30 do begin6 e0 p2 L) Y- w, G" r( l
        travel to pickaisle.con(A_i)  A6 ?" i" \0 j) f, o; F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* D4 F- _  [2 n. ^- J        else wait for 10 sec$ u4 {( M- l& [
        if A_i=A_leave then send to die
) Y9 I2 \0 N% j7 ?3 |4 K        else inc A_i by 1
  P3 Q6 q  J3 ?+ s    end
* ?# H: o0 w* jend7 Y# @. {% S( i, Y& ^2 u/ [. q2 Z  M

7 G8 y8 V' R7 ^' h' Wbegin P_pick2 arriving9 \. Q8 e. Q* a% w3 U
    set A_i to 11( |$ z4 ]* @  x' B2 r- `
    move into Q_induct2
! q& F+ _2 I( h% `# z1 `    move into pickaisle.induct2$ P( L: N' T5 b' |* `
    while A_i<=30 do begin7 g6 y3 }! h- Z2 G5 O$ H* d2 d
        travel to pickaisle.con(A_i)
  g  I. w5 X) {3 _0 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! ]. H+ r' ^# T9 F
        else wait for 10 sec
- I5 d5 t/ G& C8 ]/ ]: |        if A_i=A_leave then send to die
/ u+ p7 c" i2 ~: C# q: g        else inc A_i by 17 N6 C! ?4 ?8 z% C& O
    end9 s# ^( m4 s* f1 u
end
6 s" ?6 {4 i6 Z+ h0 j
2 I& [. n8 d( `7 ~7 l7 Nbegin P_pick3 arriving; f; |' Z6 ]2 n0 t9 l' |2 [8 z, B
    set A_i to 21
# N3 d9 y: u. ~9 a    move into Q_induct3
  n& F. ?. o; I8 Y, N4 G    move into pickaisle.induct3' Y- K) d& u! r$ ~* u6 @
    while A_i<=30 do begin
9 U, d- l1 n, z7 L' \8 s        travel to pickaisle.con(A_i)) X2 M& B! j- G, W8 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, h  v  {9 O  S  O6 s0 ]        else wait for 10 sec
) m! ~0 h% s4 I2 [& `5 y        if A_i=A_leave then send to die
' A& m! I7 v9 T3 c, K2 w        else inc A_i by 19 r5 H% e9 p# W, |; D2 Y
    end# p- n7 ~% q/ ]  a, u( x3 d& Q) T* b
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?$ P1 t  T* e: q9 O* M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- q0 C7 C2 V5 h0 n- X' n: ~: _( j6 h7 w1 P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 f. f) a* Z6 {: P! m) i0 U8 R  A3 P6 V9 R8 D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 ~. R& w8 `8 |! _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! _6 Q) t, a: ~1 D9 l' h3 y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 x9 e: @  B) o8 j& F* G1 y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 Y- X  c$ @4 W; e- @' ?6 j
begin P_induction arriving
" Q* v; i5 h: c1 c3 J# i    clone 1 load to P_pick(A_induct)
9 b1 u5 C, N6 o: I, ?end最大的系0 ]0 O" C9 i" }" l4 S5 h: o
0 n- `- s0 g& Y9 H9 X3 t6 z
begin P_pick arriving
/ s2 k: W3 }* f( k7 a    set A_i to procindex * 10 + 1
2 A3 U  L/ Z8 B* y7 t    move into Q_induct(procindex)
. x5 L) m1 u. l- Q/ u    move into pickaisle.induct(procindex)9 I  M/ P( I2 q8 m) D, W. C
    /*check the type of pickaisle.induct(i), for your last problem.*/
& d- E% y  z. B3 I
9 M& D, ~8 g: K; p$ v    while A_i<=30 do begin
+ Q1 ~( f  u$ d        travel to pickaisle.con(A_i)* G* e* r9 x5 _6 y# W" M1 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ^* X, f" f0 H3 `5 E        else wait for 10 sec
) c+ v  s+ _. q$ c: w6 C        if A_i=A_leave then send to die
: _% n6 s3 I7 p; A        else inc A_i by 1
, j# t0 W$ ~" Y/ f# x    end
5 a5 `$ G8 }7 `end
3 R0 E8 E" q* P2 X" G# S( z  _7 `8 ?7 u& n$ x4 ~2 i" V5 ]. L% c, E
其中的procindex为整形,代表当前process的序号。8 z) e+ ^  ]. \2 {" ?3 V) ]
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-8-21 06:41 , Processed in 0.017172 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表