设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10472|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 E) p- g4 h* R9 Y9 H! }
3 W, N7 k& ^' m7 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中的数值,不知道会不会有什么不妥。
8 Q5 R6 O4 g6 l9 L. D) Q3 p0 c, k0 f5 v- [) j- z9 A( z
begin P_read arriving2 q7 @; z1 e: W' R
    while 1=1 do begin
( q0 a' `1 w; z" v1 a, l4 P        read A_tote from "data.txt" with delimiter "\n"( n9 w3 T1 Y4 S- g2 h9 ~- X7 F: K( K8 p
        read A_time from "data.txt" with delimiter "\n". \5 m' c! F0 O- ^: h) B
        read A_leave from "data.txt" with delimiter "\n"% L, p) i/ R' l4 F
        read A_picks from "data.txt" with delimiter "\n"
  l& T- {0 H: b  i* w1 z) U/ L        set load type to A_tote
7 p5 P  s  {0 X        if A_tote="tote 1" then set A_induct to 1
1 C* b1 V1 p3 A( d4 B) A/ \7 T+ d        else if A_tote="tote 2" then set A_induct to 2
, k2 M2 ^& W# c2 V            else set A_induct to 3    8 N! [( ^, x, @5 `: m
        set A_i to 0. W( T% Z7 I6 J% j1 k$ Y
        clone 1 load to P_induction
$ g8 z) f+ s! ?2 c  `) W0 R        wait for A_time sec
8 \% D* B: f+ C- k  \3 A    end
& [* y3 d, z4 Y' T$ Oend8 {6 i. |: _( H" x

7 F: \/ ^% b: ~; L6 x7 _1 Lbegin P_induction arriving
1 Z0 r5 m1 `4 x! [, p& A    if A_induct=1 then clone 1 load to P_pick1) O- v5 L; I2 h8 \% y
    else if A_induct=2 then clone 1 load to P_pick2) p% r" Y/ ~  R9 y% p- @. x7 L1 k4 j
        else clone 1 load to P_pick34 e" g- n# j, U: I) a+ R
end, b9 M1 q; e$ K0 v4 D$ Z( h+ V# T

  j# M8 m& M2 e; o& N! C5 Tbegin P_pick1 arriving
/ X3 M% H7 q6 t1 K$ f  U; O+ B    set A_i to 1, ]% D* y+ k  D( k* S
    move into Q_induct1( A( e: h& k7 Q6 K+ c
    move into pickaisle.induct1
. q7 {; Q2 e1 i0 h$ u& k( I    while A_i<=30 do begin+ T  W3 t* x# Z  r2 ]% v: h: e
        travel to pickaisle.con(A_i): p/ T7 D+ p& V0 J/ t/ k, l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 \) \* z& g5 |- ?' X
        else wait for 10 sec
& q* Z. \# `: e/ C; X        if A_i=A_leave then send to die
! o) g2 a9 b3 |) f        else inc A_i by 1. r0 {' B* R3 X- @) j3 `" G
    end
8 t. }, U% c8 {/ Y, C# X3 F' xend. u1 Q) G- `4 W& y) F: N# f* A
4 |4 H9 {& Y) }, Y% ~
begin P_pick2 arriving; J  z! t4 o" P( a5 {5 g, Q8 ^$ o8 O
    set A_i to 11! g# x7 E  g8 S8 K0 {: ~4 M
    move into Q_induct2
& {( R4 p( u4 o9 Z4 K4 }( n    move into pickaisle.induct25 ^- |* V# }; i9 Z
    while A_i<=30 do begin) M8 p8 K" W; i; z. m* k
        travel to pickaisle.con(A_i)( l2 d# N4 C. a) B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }! _& k; E3 e: U4 V4 }8 x8 ]1 ]
        else wait for 10 sec( e* H& f9 f5 k, A
        if A_i=A_leave then send to die
- h0 h$ h- c2 T0 c4 D5 R1 F7 ^        else inc A_i by 1
; s0 ^( Q; @$ a) Y    end
' H4 f: H: }4 X. Bend
: Y1 v1 q: C: E0 P# a
8 R5 s0 [8 h( A# d, t9 Bbegin P_pick3 arriving
/ t, ~, ^0 a& x, L0 q, Z- `    set A_i to 21, k# b3 I" S- N5 t: x8 h, ?- L
    move into Q_induct3
0 s% o' o; `  Y    move into pickaisle.induct3
! Z* E+ I/ e* s+ s    while A_i<=30 do begin& z5 Y5 p- j+ t% g7 |$ \2 |
        travel to pickaisle.con(A_i)
, K0 u- z& @  u+ ?( H, t+ F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. E3 D& y# ]' l) d9 [9 t& c! H        else wait for 10 sec
8 ]* t5 Z& a% J& x! G/ H        if A_i=A_leave then send to die* G  t& L3 v1 o4 f; o3 K( t6 a. G
        else inc A_i by 1
! t5 G% e- K6 w% j0 h    end; P: |, r4 J2 L0 X
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是个什么东东?
  _# g- Y0 X( tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 A' o' z+ S7 f4 n2 t( p
0 m0 X' f* G: Z! p6 a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; Z" T( R  ~) D6 g. U% g4 d0 X8 v" H6 W

5 @6 J+ k* k+ A# ?7 a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ ~0 A/ ^6 g- d/ C( n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 M3 w7 Z- H" I  e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! y& F$ u3 {) E# Z( z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) y8 U: A* a9 H& X  U9 M0 Mbegin P_induction arriving
3 t0 @2 N4 W) I- E1 T; s+ l    clone 1 load to P_pick(A_induct)
! ?. v2 e7 ]/ k+ P+ P* Vend最大的系
5 v  h/ X- y0 l$ }
% L) i+ ]( J$ g3 [begin P_pick arriving
6 ]) {; D% ~" }* I' D) Y    set A_i to procindex * 10 + 1
' w' i5 q- Y8 O" Q% k. ~' P    move into Q_induct(procindex)
  q% D7 L0 g& E9 Q    move into pickaisle.induct(procindex)& K; P0 U5 p0 f5 g  g* a8 e
    /*check the type of pickaisle.induct(i), for your last problem.*/, ]7 Y2 S6 `' ^; K  I( J

4 z3 n; f! Z  e8 D% V/ a5 {+ n    while A_i<=30 do begin
+ @& z( e" a% Q! ]        travel to pickaisle.con(A_i)
& D0 l& `4 Y: b4 O4 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! U% u5 V6 y9 C  R4 t( R" G5 M* J
        else wait for 10 sec
% z, i: [% C/ _0 H+ _3 S        if A_i=A_leave then send to die& |/ Z6 d! E. M* g+ {' P. h' H
        else inc A_i by 1
' v( Q/ f8 R- q6 p) u& i    end
7 M: ~/ T5 ]7 b* eend6 A. k! B7 a( {- L2 _

/ X$ K5 U9 h0 `5 j8 N0 j9 F- [其中的procindex为整形,代表当前process的序号。
/ j8 M3 a1 b5 kstation和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-9-4 13:07 , Processed in 0.015668 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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