设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9891|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ f: j! _5 i1 ~& l, |1 y
7 [) O( {9 V& q" K5 p8 I我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 ^" S' l, y  u) u: Q& |6 P; J
3 P( K) m. s: M* [" k' ]6 M
begin P_read arriving
# Z! x  {) [; Q0 B# |& z' n( ~3 M9 p8 r# z    while 1=1 do begin
, S1 F4 v5 L5 M0 O' L        read A_tote from "data.txt" with delimiter "\n"
0 b! ^: X% a" ^. W/ g) h6 u        read A_time from "data.txt" with delimiter "\n") H: p5 W3 |% B) g! Z, M: G& R
        read A_leave from "data.txt" with delimiter "\n"
" E0 j  ?: [2 ]$ Q3 T4 V' K& O        read A_picks from "data.txt" with delimiter "\n"
# y8 N8 D& G0 I/ Q$ X) h  H        set load type to A_tote1 h* k" e8 x: x3 M# n8 b$ `
        if A_tote="tote 1" then set A_induct to 1
+ @- @% |" n. h: x; K: N        else if A_tote="tote 2" then set A_induct to 2
/ P2 t, }8 u, D9 ]) W            else set A_induct to 3   
* K) s, z1 C( Y, Z" b        set A_i to 0
7 ]1 T- I, f0 i: c: ~5 f! q        clone 1 load to P_induction
2 y3 J2 y1 P/ ~. r) L        wait for A_time sec  z  G8 o( c  h7 X% }- _9 ^
    end. q2 L% \- C' l  P
end3 }7 l& o$ v7 I% L+ X! N- c

: B0 x/ d2 I- m- C% lbegin P_induction arriving
& H; e$ g6 ?- [/ c' u- k    if A_induct=1 then clone 1 load to P_pick1* D, ~; c/ F# Z8 A
    else if A_induct=2 then clone 1 load to P_pick2( S+ q0 ?( V4 h" O) H, O
        else clone 1 load to P_pick38 P1 N) Y) E* Q# d6 y' S5 \) N& @
end  _: ?7 ?8 H7 R+ }7 }* ^: J
- j9 u8 `- T8 q" j; V+ D, y
begin P_pick1 arriving& w4 |  J% W  u! \; _- {
    set A_i to 1
  c% w0 u4 V4 m- R) V    move into Q_induct1. K& L8 t! f% X( ~- W( ^( c
    move into pickaisle.induct13 }0 o& M) S; q5 `# e
    while A_i<=30 do begin
/ ~! p) d3 u2 |* p% q4 c1 i        travel to pickaisle.con(A_i)# L' ?+ {- u) @2 Y% K2 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& S" x9 O- u% w: v1 X
        else wait for 10 sec
: l" {; q/ I& h+ v0 L$ d        if A_i=A_leave then send to die
4 a! V! Y$ g2 M( e" ~- I5 R        else inc A_i by 1
. K0 k) i( i; o5 f    end) R1 J6 ]& [* ^& v+ z0 C
end
9 H& T: S7 q4 C' D/ N
, z3 N( r" G. C- ^/ n# ebegin P_pick2 arriving
2 z1 C4 M: l- z    set A_i to 11
$ I: M: \* X. a% [/ g" E8 q    move into Q_induct2' E' a1 [8 N- N$ j  t: k! A2 d
    move into pickaisle.induct2
4 m+ d6 B( i2 @7 A; i5 J& O# _    while A_i<=30 do begin+ c) W8 i: _$ S7 p' F0 f/ ^
        travel to pickaisle.con(A_i)
) f( N/ g7 N5 A( b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 t- F' U' P" I2 |
        else wait for 10 sec
1 n4 x( i& @. B$ l5 n6 n        if A_i=A_leave then send to die  k6 K' ], U, T. u
        else inc A_i by 17 Z2 e5 O  D) I+ j5 o
    end  |7 _4 p0 Q& A1 \0 T3 I' Y+ F' Z/ E
end
1 R: o% q" j$ `* U) p2 U9 G; C: `7 t! C' v0 E  v) Z
begin P_pick3 arriving) |- K2 k: _+ \% u7 l
    set A_i to 21
3 R2 U. B3 ]1 u+ c    move into Q_induct37 F! K2 V/ I. ?9 B4 T& \
    move into pickaisle.induct3
, O, O: I# @2 }1 Z) J: q6 O    while A_i<=30 do begin) c/ p* |2 O9 y2 ^8 k" Y5 E. r7 F
        travel to pickaisle.con(A_i)
0 i* u, z1 T  X# E/ {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# U. A/ s* R9 k% A6 t3 N        else wait for 10 sec+ I; ]; x* {& q9 S  ]3 r
        if A_i=A_leave then send to die" w& l0 a9 O+ m
        else inc A_i by 1
; J3 a/ t0 t6 {+ x5 y. N    end
. s, V8 F6 B* uend

最佳答案

查看完整内容

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是个什么东东?( P5 v" w, k; i+ Q5 b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 k% O. I* F' n/ B( Z+ H

) ^) g8 e  D& Y) X8 J5 x3 C) ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 d; o. u5 Z  c3 G9 x: n/ n; r0 I$ t/ W- [( x$ G, c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 m, A  Q$ k7 u! |5 v. i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 A/ E3 t( w) o, U7 ^) b: O( g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: L' @# W' V0 `  V2 f9 V# d1 x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 ?; F7 v0 _7 cbegin P_induction arriving& j/ ~1 P: f  w) E4 p
    clone 1 load to P_pick(A_induct)) r8 U/ _; S9 P2 s8 |4 D
end最大的系- a; v0 U9 ~; C7 x* b% {0 u4 F4 B

( |9 x' x& b# V6 r  e! pbegin P_pick arriving& {) D4 z4 S3 i* @' {( v# t; l
    set A_i to procindex * 10 + 1
  _9 J$ ?9 G) Z. N    move into Q_induct(procindex)+ Z7 o8 K6 V+ e
    move into pickaisle.induct(procindex)
3 ?) f  s5 Y( g- Q2 |    /*check the type of pickaisle.induct(i), for your last problem.*/
( C2 ~& Q# s, `" `: a4 W$ e$ R5 \: C& v- A
9 o; Q5 ~, N& K; [8 _    while A_i<=30 do begin9 m- H- G. v& {
        travel to pickaisle.con(A_i)
9 o9 |- x* t2 {( r+ ]! }% Z: T. M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& g6 S- Z- O6 ~3 |- G$ `+ ^& V6 d- E        else wait for 10 sec3 B' T5 C& l0 V# {5 i5 @: {. @
        if A_i=A_leave then send to die
) e' ^6 v5 |9 K" f. m! M/ P7 r        else inc A_i by 1* |9 J+ a; w5 E+ j) e
    end% o- {0 R. T' X. b
end
; K: A- B0 a- Y* V' ?/ v+ t9 S6 X$ H/ B5 e
其中的procindex为整形,代表当前process的序号。% F3 D* j/ ~8 c
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-7-15 04:54 , Processed in 0.013439 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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