设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13900|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  t3 |& Q  `& q4 ~
% b, z$ _6 |5 d" J2 K7 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, O1 f1 E, U" f) T6 T) h2 w* F- o
0 F; `4 w4 w% T1 Z* a/ X" l. Hbegin P_read arriving
! H9 z. g4 s2 ]    while 1=1 do begin
9 B1 d. ~* m$ T6 B        read A_tote from "data.txt" with delimiter "\n"
4 J" r& e$ a* z/ z4 `2 q        read A_time from "data.txt" with delimiter "\n"% N( E1 F) M) ~; X0 U
        read A_leave from "data.txt" with delimiter "\n"* L6 E2 ]% k1 Q* n8 Z
        read A_picks from "data.txt" with delimiter "\n"1 a3 h& g4 c3 d* d; J
        set load type to A_tote- Z4 Y7 N) d$ L3 X
        if A_tote="tote 1" then set A_induct to 1+ h+ \$ _& [0 h" @2 p
        else if A_tote="tote 2" then set A_induct to 2
% n9 b7 J% H# Z+ j- b            else set A_induct to 3    / ^6 Q) p2 P1 a$ Z$ b$ J
        set A_i to 0
) }3 Z! g/ A  `- |3 C        clone 1 load to P_induction/ J9 n5 A% K3 U' C( a" _& h% @
        wait for A_time sec
+ i) [; N" L+ n+ I% s1 i/ }    end& g# F: u0 a2 e8 {  n+ D/ E
end
  t! t% x, A! N0 H/ [  K
2 Y/ ~, a- o% R$ c9 K* fbegin P_induction arriving
. N+ l9 V  T6 f8 y# j+ y    if A_induct=1 then clone 1 load to P_pick1
: @5 N% W5 R. B& I! H% c2 f- o6 k    else if A_induct=2 then clone 1 load to P_pick2
1 n+ t5 c- e$ D! A, G        else clone 1 load to P_pick3! b1 C& ?8 d- @: K8 h/ b
end3 [2 X$ G+ b8 B+ j

7 J; b1 j; B: g/ mbegin P_pick1 arriving
; g  g$ F0 i8 h8 k# p    set A_i to 1
6 x$ |6 r/ _' c* ^7 Z    move into Q_induct1
- u( ]: O6 @' ]    move into pickaisle.induct1
* O1 N5 [. y4 a+ V- S4 Q2 I% n    while A_i<=30 do begin" N! v8 g8 r2 \0 H' k
        travel to pickaisle.con(A_i)
2 ^* w4 I  A' W1 h% z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) {8 t& H( N% H$ z: _* k# Z
        else wait for 10 sec3 s0 E4 u, S4 t0 b
        if A_i=A_leave then send to die- W2 I4 S1 V& }5 c, A1 W
        else inc A_i by 1! p: {2 `- R3 c1 B) y0 C1 ~- l* e
    end. L7 d. k' `- C* w: c8 o+ |+ J" B
end
3 }& [% v+ C* ?; U1 e: l4 Q* j& m* }$ k
begin P_pick2 arriving
  f4 z. x1 N- }  r5 p    set A_i to 111 z; Q& K" f. F$ A
    move into Q_induct2
- v& v6 u9 a% \( Q+ n4 w) w    move into pickaisle.induct2  c( ~2 L, P/ E9 l- u
    while A_i<=30 do begin
, l( Q0 R7 F# |( m0 k" o( z( F& g        travel to pickaisle.con(A_i)
. D0 n* F6 n9 W* l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 R0 a; f, ]- d0 L# L
        else wait for 10 sec
% }# U! @$ M) Q0 J* N        if A_i=A_leave then send to die& z$ |7 ^# v# r2 W/ O
        else inc A_i by 1
8 X* n5 Z' n  d* i    end4 d0 K- Z9 V' ~8 U& A
end
# Q1 x4 r5 {& ~8 m- o* j1 r3 |0 P. ^0 ~2 Q
begin P_pick3 arriving
6 |; j8 [8 k! H+ ^    set A_i to 21
$ m4 ~, n; R0 X' e    move into Q_induct3
" E6 g% d- x) v: @+ u6 @    move into pickaisle.induct3
* w- ?( q) U' f! u! C2 d* [    while A_i<=30 do begin
0 `; [; o& I! A" Y        travel to pickaisle.con(A_i). `. i- }  C. `4 l) w+ u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& m! k- L6 r2 W2 X- z/ |" }* G( c        else wait for 10 sec
, v: l- C. d3 }7 @, e) |5 B  B        if A_i=A_leave then send to die0 k; p  t5 N, l: a. Q2 z, O# q
        else inc A_i by 1
* F5 V2 }4 d0 h" C1 N; F    end
. p& U+ ~8 S, a8 U  z' e3 Tend

最佳答案

查看完整内容

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是个什么东东?
/ t1 M+ S1 E% J2 W; Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" d6 {1 k/ c& E2 u# j0 z
7 E# `4 b( n0 z$ D: y; Q. d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 e, U  P7 K6 {' p
3 ?" [% j( {  u( _( ?% e0 l( c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( a! W/ c, C* L3 E4 E5 t1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; u: P3 P8 n# t' m) I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' ^) u3 H+ O$ j3 M( Z, y, [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 y# Z* P' g0 C2 m) Z8 b' t7 s
begin P_induction arriving4 Y+ }% v! A8 R- D" J
    clone 1 load to P_pick(A_induct)6 ~/ P" I, v  f, r" w9 m
end最大的系' M4 m; p  u' g" i/ c

! E) ]* L. o$ |! a# L9 L  }begin P_pick arriving: s4 f7 o2 [# e% F' T5 S
    set A_i to procindex * 10 + 19 U0 e0 n/ ^, j$ ~* S: M
    move into Q_induct(procindex)
$ B0 s# Y0 `1 V9 ?    move into pickaisle.induct(procindex)
" \0 G; @+ O; P4 `! y% r    /*check the type of pickaisle.induct(i), for your last problem.*/
& O- w, U/ I& V0 A( L1 h& l8 f: x0 ?' _
    while A_i<=30 do begin1 }1 w5 ~+ r) p. F2 K8 V( Y
        travel to pickaisle.con(A_i)0 x$ K  ?+ a4 V* a( T, A; J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& {* T6 ]# f( o% P* N4 j' J
        else wait for 10 sec
* k& T/ G& u  b4 i: @3 z3 x/ P; m8 A! w        if A_i=A_leave then send to die
, k6 f) z$ _7 ^( R        else inc A_i by 12 N2 b8 @1 i2 \
    end0 j4 S+ W9 z+ R4 \9 H
end4 V. Q! o/ {6 j0 l$ C  U) z2 I

" B# I% W# B6 V+ Z! z其中的procindex为整形,代表当前process的序号。1 ~7 h% ^( U6 L# v: B6 q
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-5-16 21:12 , Processed in 0.017792 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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