设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11571|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& c; M% k6 K2 I; C9 p- j# D
8 s! L/ h, Q5 e1 b# ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。- ~7 i4 U1 ^5 Z6 d/ O" E' X* Q
+ D7 m' e( i: m1 L" }; v' `' A
begin P_read arriving  G( x+ k) b. k7 h6 V* `
    while 1=1 do begin
* g* U% d' L9 Z) Z* p        read A_tote from "data.txt" with delimiter "\n"; a# {# K; [6 O! f; [8 I
        read A_time from "data.txt" with delimiter "\n"
3 F9 z7 E7 ?. w' [( \* \/ g: \* b        read A_leave from "data.txt" with delimiter "\n"% s" i$ C: S& z" i" |1 O
        read A_picks from "data.txt" with delimiter "\n"7 u. S) n6 I# O: o. m1 f
        set load type to A_tote6 M, n. _. U; _+ }) B8 Q# w5 Q$ V& @( @
        if A_tote="tote 1" then set A_induct to 1) L  R) ~' e: O: u, F/ J/ Q
        else if A_tote="tote 2" then set A_induct to 2& q/ s' A" M0 {: ?: W0 u
            else set A_induct to 3   
: x& V5 p: r/ I! [        set A_i to 0
# |: q) Z6 r! O  T1 ]/ R" R        clone 1 load to P_induction) X1 m" a3 v  B# e9 m
        wait for A_time sec4 \6 N, p7 P9 Y8 M4 P
    end* v; o4 e+ G( b  D# [  @; P
end
. ~2 J- j1 I* J
! a! ]. e+ S* Vbegin P_induction arriving
" C6 ~% r& J  B    if A_induct=1 then clone 1 load to P_pick1* k# W) J2 U* J6 [" f
    else if A_induct=2 then clone 1 load to P_pick2  M/ R# V; n# }* Z) ^
        else clone 1 load to P_pick30 A9 |; m. B0 N7 _) o
end$ `4 H% F) r1 C. T% j3 W$ o
/ E& t/ W$ b+ }4 q- c6 ^* s
begin P_pick1 arriving. C  t3 L$ e* _: z& A, v
    set A_i to 1
$ F2 f7 G; }1 z* ?( o    move into Q_induct1
! C; Y& o5 g: U# ~" r    move into pickaisle.induct19 w1 [! Y8 Q. p- y
    while A_i<=30 do begin
; G/ b7 j3 x, H* L3 O9 t7 g" p        travel to pickaisle.con(A_i)2 @" Z2 ?" J3 i5 s4 I) t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 n8 @' X1 ?  U
        else wait for 10 sec
5 S: V" `2 S7 B9 J1 j9 |        if A_i=A_leave then send to die
3 ~) u! y, J. n4 w4 @" P        else inc A_i by 1, v9 Z* B( Z% D$ V# N) N
    end6 g  g" w9 E! {( n4 _
end
5 p3 Z* g$ E1 V
& @- u/ R9 e3 e2 Q. G0 k; y/ A* @8 [begin P_pick2 arriving
; ^0 y' s. T* h7 ?, q    set A_i to 11
" K& D# t- U4 C    move into Q_induct2
* v0 c& z) I; \    move into pickaisle.induct2! m" [1 Y5 L: X& z% y( |0 A8 e; Y9 `
    while A_i<=30 do begin/ `4 U$ Z8 E6 j) K- P
        travel to pickaisle.con(A_i)4 b) M; d& ]# D* E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t$ K' P$ r4 i7 ]2 r# d2 n
        else wait for 10 sec
% _7 {  |# U6 f/ E3 a5 I: ]        if A_i=A_leave then send to die5 m8 r$ R  N4 t+ [. m( a( Q6 l  S. o
        else inc A_i by 1
/ w, B1 H+ X) e* Z) W    end- E) w% W! p* ^6 h
end: J5 Y* D, p! W& W+ y7 c
2 C) x3 |- u: w6 h
begin P_pick3 arriving
2 B" T/ R1 x/ T  c( _4 n' ^1 L  @    set A_i to 21
  @  c' j) I7 ]' M    move into Q_induct3
. l3 ?2 L: o" ]' }  }    move into pickaisle.induct3
5 v9 ]9 F& w7 Z* q$ r0 i* x, N    while A_i<=30 do begin5 U7 H$ o2 s9 f# L
        travel to pickaisle.con(A_i)
; j% s; A# n+ K8 K; S4 p1 I& z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" G5 \" V  B) z        else wait for 10 sec
$ K! t5 J: ?0 B5 e        if A_i=A_leave then send to die0 E2 O3 z9 \1 F3 W: o
        else inc A_i by 1. ]( U5 U" B( z) O$ Q: g
    end  m! x) T! H3 y" [- W
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是个什么东东?1 |4 N. c2 Y+ ]- I) V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- N! F; v3 @2 O" }) |1 C/ v* W- I7 d
; J' C& ]! ]$ m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ ~2 s8 I  ], `1 A7 X

$ H! C4 v; K- Q: [# p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 e  _$ z2 W7 A4 U  d2 i4 p( q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 Y: W& F2 ]- D1 J7 x+ x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 j# b3 X$ G, V4 n1 @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ p8 E: Q3 ]( J' G  c" l
begin P_induction arriving, u8 U+ s' l, [+ i' G4 ]
    clone 1 load to P_pick(A_induct)
& t8 e8 _, `  i# U- d+ Z1 H$ o3 tend最大的系
  @; D- Q% Q5 j& H+ A2 I! t0 V1 l% v  S8 ?0 x
begin P_pick arriving
0 {$ L( U' x# a" |    set A_i to procindex * 10 + 1; s6 K3 _7 u# ^5 v8 [
    move into Q_induct(procindex)
4 N& i5 V) K4 w9 X& T! e& U    move into pickaisle.induct(procindex)9 a  @/ t1 _0 b% d: m
    /*check the type of pickaisle.induct(i), for your last problem.*/
: I$ O0 A+ `( O( |' J: N
" G. O8 M6 W9 N% v/ [* B. ~    while A_i<=30 do begin8 B# V6 S1 H8 q+ _6 ]
        travel to pickaisle.con(A_i)
3 N/ I5 T5 C+ T- d' H# o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* B7 I2 g+ T- L( I0 s( b2 [4 Z" }
        else wait for 10 sec
( _/ M, a; I+ [1 \1 t+ ]$ q        if A_i=A_leave then send to die
" T* n/ w; w, a" H        else inc A_i by 1
+ ?- m% S) r5 N" b    end
1 @/ S, @" [; @, p8 c/ |end# a' J0 p1 L+ d. `2 h  A; x. U& |, M
5 Q2 Q  G! J# V
其中的procindex为整形,代表当前process的序号。6 o  F, e8 n6 B4 d8 m, F* r
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, 2025-11-21 12:54 , Processed in 0.021968 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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